Skip to content

Commit 0c37e9e

Browse files
committed
make the non-generic Option and Argument ctors non-private
1 parent 3132acb commit 0c37e9e

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

src/System.CommandLine/Argument.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ public abstract class Argument : Symbol
1919
private List<Func<CompletionContext, IEnumerable<CompletionItem>>>? _completionSources = null;
2020
private List<Action<ArgumentResult>>? _validators = null;
2121

22-
private protected Argument(string name) : base(name, allowWhitespace: true)
22+
/// <summary>
23+
/// Initializes a new instance of the Argument class.
24+
/// </summary>
25+
/// <param name="name">The name of the argument. This can be used to look up the parsed value and is displayed in help</param>
26+
protected Argument(string name) : base(name, allowWhitespace: true)
2327
{
2428
}
2529

src/System.CommandLine/Argument{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class Argument<T> : Argument
1515
/// <summary>
1616
/// Initializes a new instance of the Argument class.
1717
/// </summary>
18-
/// <param name="name">The name of the argument. It's not used for parsing, only when displaying Help or creating parse errors.</param>>
18+
/// <param name="name">The name of the argument. This can be used to look up the parsed value and is displayed in help</param>
1919
public Argument(string name) : base(name)
2020
{
2121
}

src/System.CommandLine/Option.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ public abstract class Option : Symbol
1717
internal AliasSet? _aliases;
1818
private List<Action<OptionResult>>? _validators;
1919

20-
private protected Option(string name, string[] aliases) : base(name)
20+
/// <summary>
21+
/// Initializes a new instance of the <see cref="Option"/> class.
22+
/// </summary>
23+
/// <param name="name">The name of the option. This is used during parsing and is displayed in help.</param>
24+
/// <param name="aliases">Optional aliases by which the option can be specified on the command line.</param>
25+
protected Option(string name, string[] aliases) : base(name)
2126
{
2227
if (aliases is { Length: > 0 })
2328
{

src/System.CommandLine/Option{T}.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public class Option<T> : Option
1414
/// <summary>
1515
/// Initializes a new instance of the <see cref="Option"/> class.
1616
/// </summary>
17-
/// <param name="name">The name of the option. It's used for parsing, displaying Help and creating parse errors.</param>>
18-
/// <param name="aliases">Optional aliases. Used for parsing, suggestions and displayed in Help.</param>
17+
/// <param name="name">The name of the option. This is used during parsing and is displayed in help.</param>
18+
/// <param name="aliases">Optional aliases by which the option can be specified on the command line.</param>
1919
public Option(string name, params string[] aliases)
2020
: this(name, aliases, new Argument<T>(name))
2121
{

0 commit comments

Comments
 (0)