how to best handle two sets of arguments?

Sep 14, 2012 at 8:47 PM

My app is executed in two different modes ("read" and "write") each of which has its own separate set of required and options arguments. So I want to run it as follows


myApp.exe read -a var_for_a -b val_for_b ...



myApp.exe write -c var_for_c ...

What's the best way to handle this using your library? Should I create separate classes

class ReadOptions : CommandLineOptionsBase {}

class WriteOptions : CommandLineOptionsBase{}

and then invoke CommandLineParser.Default.ParseArguments depending on what args[0] is, or is it better to do it with a single Options class?



Feb 24, 2013 at 6:25 AM
I suggest you to read the wiki first and then come back to ask what is not clear.

Btw, use a newest version and you'll not care about CommandLineOptionsBase.