command-line-parsing

Examples of getting it wrong first, on purpose

I just caught myself doing something I do a lot, and wanted to generalize it, express it, share it and see who else is following this general practice, to find some other example situations where it might be relevant. The general practice is getting something wrong first, on purpose, to establish that everything else is right before und...

A good C alternative for Boost.Program_options?

Any good alternative written in C to replace Boost.Program_options? Given it's able to parse: Short options like -h Long options like --help --input-file Parse repeated keys/options Accepts key-value pairs: --mysql=/usr/lib Parsing environmental variables and XML/INI files is optional. ...

Parsing command-line options in C#

I've seen people write custom classes to more easily handle command line options in various languages. I wondered if .NET (3.5 or lower) has anything built in so that you don't have to custom-parse things like: myapp.exe file=text.txt ...

How to enforce required command-line options with NDesk.Options?

I was just writing a console utility and decided to use NDesk.Options for command-line parsing. My question is, How do I enforce required command-line options? I see in the docs that: options with a required value (append '=' to the option name) or an optional value (append ':' to the option name). However, when I put a = at the ...

Command Line in Batch file?

I am making a batch file to automate mysql installation silently. When I type the following line in the command prompt everything works fine. "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqlinstanceconfig.exe" -i -q ServiceName="mydb" RootPassword="pos" ServerType=DEVELOPMENT DatabaseType=INNODB Port=3306 My question is: can I someh...

Parse string as if it was a command with params and options

I have this Java enum: public enum Commands { RESIZE_WINDOW("size -size"), CREATE_CHARACTER("create-char -name"), NEW_SCENE("scene -image"), DIALOG("d -who -words"), PLAY_SOUND("sound -file --blocking=false"), FADE_TO("fade-to -file"), WAIT("w -length=auto"); } I want to be able to parse those strings and e...

Evaluation request for my command-line arguments parser. please help

Because of certain special requirements of one of the C# applications I was developing, I had to write my own command-line arguments parser library. With the limited documentation available for GNU getopt (at least I couldn't find much immediately) and with my limited exposure to the open-source world, I couldn't comprehensively evaluate...