-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor object types into separate files. * Ensure that we do a case-insensitive parse of the enum. * Bump package version in preparation of release. * Add a couple more tests.
- Loading branch information
1 parent
ecd99b2
commit 1d29354
Showing
9 changed files
with
126 additions
and
60 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
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,8 @@ | ||
namespace CommandLine.Tests | ||
{ | ||
public enum Action | ||
{ | ||
Create, | ||
List | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using CommandLine.Attributes; | ||
using CommandLine.Attributes.Advanced; | ||
|
||
namespace CommandLine.Tests | ||
{ | ||
class OverridePositionGroup2 | ||
{ | ||
[ActionArgument] | ||
public Action Action { get; set; } | ||
|
||
[ArgumentGroup(nameof(Action.List), 0)] | ||
[ArgumentGroup(nameof(Action.Create), 1)] | ||
[RequiredArgument(0, "milestoneInputFile", "The file containing the list of milestones to create.")] | ||
public string MilestoneFile { get; set; } | ||
|
||
[ArgumentGroup(nameof(Action.Create), 0)] | ||
[ArgumentGroup(nameof(Action.List), 1)] | ||
[RequiredArgument(1, "repo", "The list of repositories where to add the milestones to. The format is: owner\\repoName.")] | ||
public string Repository { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using CommandLine.Attributes; | ||
using CommandLine.Attributes.Advanced; | ||
|
||
namespace CommandLine.Tests | ||
{ | ||
class OverridePositionGroupWithMoreArgs | ||
{ | ||
[ActionArgument] | ||
public Action Action { get; set; } | ||
|
||
[ArgumentGroup(nameof(Action.List), 1)] | ||
[ArgumentGroup(nameof(Action.Create))] | ||
[RequiredArgument(0, "milestoneInputFile", "The file containing the list of milestones to create.")] | ||
public string One { get; set; } | ||
|
||
[ArgumentGroup(nameof(Action.List), 0)] | ||
[ArgumentGroup(nameof(Action.Create))] | ||
[RequiredArgument(1, "milestoneInputFile2", "The file containing the list of milestones to create.")] | ||
public string Two { get; set; } | ||
|
||
[ArgumentGroup(nameof(Action.List), 2)] | ||
[ArgumentGroup(nameof(Action.Create))] | ||
[RequiredArgument(2, "repos", "The list of repositories where to add the milestones to. The format is: owner\\repoName.")] | ||
public string Three { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using CommandLine.Attributes; | ||
using CommandLine.Attributes.Advanced; | ||
using System.Collections.Generic; | ||
|
||
namespace CommandLine.Tests | ||
{ | ||
internal class OverridePositionGroup_Conflict | ||
{ | ||
[ActionArgument] | ||
public Action Action { get; set; } | ||
|
||
[ArgumentGroup(nameof(Action.List), 0)] | ||
[RequiredArgument(1, "repos", "The list of repositories where to add the milestones to. The format is: owner\\repoName.", true)] | ||
public List<string> Repositories { get; set; } | ||
|
||
[ArgumentGroup(nameof(Action.List))] | ||
[RequiredArgument(0, "test", "The list of repositories where to add the milestones to. The format is: owner\\repoName.", true)] | ||
public List<string> Repositories2 { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using CommandLine.Attributes; | ||
using CommandLine.Attributes.Advanced; | ||
using System.Collections.Generic; | ||
|
||
namespace CommandLine.Tests.TestObjects | ||
{ | ||
// define required collection property as first one | ||
class SimpleType3 | ||
{ | ||
/// <summary> | ||
/// Type of action by files | ||
/// </summary> | ||
[RequiredArgument(0, "action", "what need do: convert or unconvert")] | ||
public ActionType ActionType { get; private set; } | ||
} | ||
|
||
/// <summary> | ||
/// Action type | ||
/// </summary> | ||
public enum ActionType | ||
{ | ||
Convert, | ||
UnConvert | ||
} | ||
} |