If you use this release, instead of highest stable
, remember to donwload (as last) the libcmdline-1.5-stable-fix.zip
file and follow simple instructions in the README file (it's very easy: just replace one file and recompile). If you are accustomed to use binaries (without recompiling your own), the fix archive
contains these files recompiled for you. More info on this post
of my technical blog.
- This new release introduces automatic support for enumeration types, minor internal refactoring and unit-test code base refactoring and extension.
- The sample application was updated for reflect all feature of the library.
- The source package includes the SandCastle project (shfb) for build the CHM file.
Define your own enumeration or use an existing one.
Define your option class, target of parsing process.
/* ... */
[Option("f", "desktopbg", HelpText = "Image of the fruit to use as desktop background.")]
public FruitTypes DesktopBackground = FruitTypes.Unknown;
/* ... */
Now make your ParseArguments()
method invocation as you always do. At command line level you must
omit the enumeration type name: just use the its element name
X:\> SampleApp -f Strawberry
$ mono SampleApp.exe --desktopbg Pear