diff --git a/Documentation/OptionalArguments.md b/Documentation/OptionalArguments.md index 414ebc4..2b79cb1 100644 --- a/Documentation/OptionalArguments.md +++ b/Documentation/OptionalArguments.md @@ -257,7 +257,7 @@ Additional group: ``` ## Mutual Exclusion -If you add options to the mutually exclusive group, **NetArgumentParser** will make sure that only one of the arguments in this group was present on the command line. Note that currently mutually exclusive groups don't have title and description (it will not be displayed in the help output). Moreover, you cannot add options to the option set using mutually exclusive group. This group is intended only to mark options that are already added. +If you add options to the mutually exclusive group, **NetArgumentParser** will make sure that only one of the arguments in this group was present on the command line. Note that title and description of mutually exclusive group will not be displayed in the help output. Moreover, you cannot add options to the option set using mutually exclusive group. This group is intended only to mark options that are already added. You can create mutually exclusive group using `AddMutuallyExclusiveOptionGroup()` method of the `ArgumentParser` class. Options can be added to this group by passing them to method `AddMutuallyExclusiveOptionGroup()` or by calling method `AddOptions()` of the created group. @@ -270,8 +270,10 @@ var nickOption = new ValueOption("nick", afterValueParsingAction: t => n var parser = new ArgumentParser(); parser.AddOptions(options); -MutuallyExclusiveOptionGroup group = - parser.AddMutuallyExclusiveOptionGroup([nameOption, nickOption]); +MutuallyExclusiveOptionGroup group = parser.AddMutuallyExclusiveOptionGroup( + "group", + "description", + [nameOption, nickOption]); parser.Parse(new string[] { "--name", "John" }); // name: John parser.Parse(new string[] { "--nick", "mr.john" }); // nick: mr.john diff --git a/Documentation/Subcommands.md b/Documentation/Subcommands.md index 660ad24..685e825 100644 --- a/Documentation/Subcommands.md +++ b/Documentation/Subcommands.md @@ -35,7 +35,7 @@ Subcommand subcommand = parser.AddSubcommand("name", "description"); subcommand.AddOptions(new FlagOption("verbose", afterHandlingAction: () => verbose = true)); subcommand.AddConverters(new ValueConverter(Convert.ToInt32)); -OptionGroup subcommandGroup = subcommand.AddOptionGroup("group", string.Empty); +OptionGroup subcommandGroup = subcommand.AddOptionGroup("group", "description"); subcommandGroup.AddOptions(new FlagOption("debug", afterHandlingAction: () => debug = true)); ```