-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add MyGet package provider to consume the daily builds. (#566) * Options groups take in account default value * Do not allow options groups and exclusive set names to be used together * Multiple group errors are shown together * MissingGroupOptionError compare option names Co-authored-by: Mohamed Hassan <[email protected]>
- Loading branch information
1 parent
5196aa9
commit 32bbe00
Showing
7 changed files
with
180 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/CommandLine.Tests/Fakes/Options_With_Multiple_Groups.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace CommandLine.Tests.Fakes | ||
{ | ||
public class Options_With_Multiple_Groups | ||
{ | ||
[Option('v', "version")] | ||
public string Version { get; set; } | ||
|
||
[Option("option11", Group = "err-group")] | ||
public string Option11 { get; set; } | ||
|
||
[Option("option12", Group = "err-group")] | ||
public string Option12 { get; set; } | ||
|
||
[Option("option21", Group = "err-group2")] | ||
public string Option21 { get; set; } | ||
|
||
[Option("option22", Group = "err-group2")] | ||
public string Option22 { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/CommandLine.Tests/Fakes/Simple_Options_With_OptionGroup_MutuallyExclusiveSet.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace CommandLine.Tests.Fakes | ||
{ | ||
public class Simple_Options_With_OptionGroup_MutuallyExclusiveSet | ||
{ | ||
[Option(HelpText = "Define a string value here.", Group = "test", SetName = "setname", Default = "qwerty123")] | ||
public string StringValue { get; set; } | ||
|
||
[Option('s', "shortandlong", HelpText = "Example with both short and long name.", Group = "test", SetName = "setname")] | ||
public string ShortAndLong { get; set; } | ||
|
||
[Option('x', HelpText = "Define a boolean or switch value here.")] | ||
public bool BoolValue { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/CommandLine.Tests/Fakes/Simple_Options_With_OptionGroup_WithOptionDefaultValue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace CommandLine.Tests.Fakes | ||
{ | ||
public class Simple_Options_With_OptionGroup_WithOptionDefaultValue | ||
{ | ||
[Option(HelpText = "Define a string value here.", Required = true, Group = "test", Default = "qwerty123")] | ||
public string StringValue { get; set; } | ||
|
||
[Option('s', "shortandlong", HelpText = "Example with both short and long name.", Required = true, Group = "test")] | ||
public string ShortAndLong { get; set; } | ||
|
||
[Option('x', HelpText = "Define a boolean or switch value here.")] | ||
public bool BoolValue { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters