.NET command line parsing
Tuesday, July 22nd, 2008For a project I’m working on I needed an assembly that would easily parse a command line.
“A command line? What’s that?” you might ask. I understand that most of the programs you run always start up with a GUI that you can then use to set up all your parameters. This is not always the Right Thing to do. A lot of what I program are utility programs that do things to files in a scripted (or batch) mode. GUIs, in this case, just get in the way. Thus the command line – you tell the program what to do when you start it up and it never talks to you again.
For example:
playMP3 --directory /myhome/music --background true
The convention is that a long name option has two preceding – (dash) characters and a short name option (a single character) has a single preceding dash character.
