How to read them?
What are best practices?

 

 

I’m not finding a lot out there in the DotNet world explaining this very well.
GNU/Linux/Perl -- yeah, that’s fine. Lots of good info and libraries.

 

 

So.

 

Install Context

Weirdly, the InstallContext object will parse  string[] args into a neat StringDictionary  of <key,value> pairs.

 

What’s not so neat is that there is no simple method to convert the dotnet 1.0 StringDictionary into the more modern generic Dictionary<string,string>. It’s not tough, just requires some custom coding each time. Annoying.

 

Plus, InstallContext does seem.... weird, and requires an explicit reference to the System.Configuration.Install namespace.

 

http://www.pcreview.co.uk/forums/parsing-command-line-arguments-installcontext-t1370746.html

 

 

 

nDesk

http://www.ndesk.org/Options - has 3.0 features, but can still be used with 2.0.... hrm.

Options is referenced by this CodeProject article.

 

I have a (private) gist that needs to be cleaned up, showing usage.

 

 

 

other possibilities

http://commandline.codeplex.com/
http://www.codeproject.com/KB/cs/CommandParserCSharp.aspx
http://stackoverflow.com/questions/491595/best-way-to-parse-command-line-arguments-in-c
http://stackoverflow.com/questions/108728/suggestions-for-implementation-of-a-command-line-interface

 

 

This interesting library uses LINQ, which is nice, but since I still do a lot of work in 2.0 environments, that is not a great option for me.

 

The GnuGetOp port looks interesting, (but) high-powered, and I couldn’t make any headway on the docs in the first five minutes. I don’t ask that I can use the full power of a library immediately, but if I don’t understand a thing after five minutes, I’ll go somewhere else.