beta 2

Rating: No reviews yet
Downloads: 220
Released: Aug 22, 2009
Updated: Aug 22, 2009 by gsscoder
Dev status: Beta Help Icon

Recommended Download

Source Code libcmdline-
source code, 255K, uploaded Aug 22, 2009 - 108 downloads

Other Available Downloads

Application libcmdline-
application, 272K, uploaded Aug 22, 2009 - 50 downloads
Documentation libcmdline-
documentation, 134K, uploaded Aug 22, 2009 - 62 downloads

Release Notes

This release ( beta 2) introduces mutually exclusive options, fixes reported bugs and turns into reality many user requests (see Discussions and Issue Tracker).


- Parsing no value or null string (in case of string option) fails, with the result of returning false from ParseArguements(...) overloads.
- The type ParserSettings was renamed with a more consistent CommandLineParserSettings. Now is coupled with the main implementation of ICommandLineParser (CommandLineParser) and decoupled from this interface. A new boolean property was added, named MutuallyExclusive, for enable or disable the rule that governs the relative feature.
- The attribute type OptionAttribute (and derived types) has a new string property MutullyExclusiveSet (see bool CommandLineParserSettings::MutuallyExclusive).
- It's now possible to specify a single dash (-) as non option input argument. Some programs (e.g.: unix tool tar) use this token for specify STDIN.
- With void HelpText::AddPostOptionsLine(string) you can now add text lines at the end of the help text buffer (after the options block, if present).
Download the documentation package for a detailed API guide (it contains a CHM help file).

Mutually Exclusive Options

The main feature introduced with this version is the possibility to define multiple set of mutually exclusive options.
For use this feature, as first thing, you must enable it:
CommandLineParserSettings settings = new CommandLineParserSettings();
settings.MutuallyExclusive = true;
Then create your parser instance:
ICommandLineParser parser = new CommandLineParser(settings);
Define your options class as you normally do, just use the new property:
[Option("f", "fun",
    HelpText = "This is a sample option, included in a small tutorial.",
    MutuallyExclusiveSet = "SampleSet")]
public bool HaveFunWithThisFeature;
You can also set MutuallyExclusiveSet to null (or string.Empty) and the library will assign automaticcally a name (this is useful when you want define only one set).
Note: The consistency check of mutually exclusiveness is done inside each set.
For more samples you can view the unit test relative to this feature, read MutuallyExclusiveParsingFixture.cs.

Beta Status

Reverting to beta status may break compatibility with previous stable release. It is also not guaranteed that next version will keep changes introduced here with the same design (but in case of a beta 2, like this, is highly probable).
See the section of change log relative to this release.

Reviews for this release

No reviews yet for this release.