Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/System.CommandLine/Argument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ public abstract class Argument : Symbol
private List<Func<CompletionContext, IEnumerable<CompletionItem>>>? _completionSources = null;
private List<Action<ArgumentResult>>? _validators = null;

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

Expand Down
2 changes: 1 addition & 1 deletion src/System.CommandLine/Argument{T}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Argument<T> : Argument
/// <summary>
/// Initializes a new instance of the Argument class.
/// </summary>
/// <param name="name">The name of the argument. It's not used for parsing, only when displaying Help or creating parse errors.</param>>
/// <param name="name">The name of the argument. This can be used to look up the parsed value and is displayed in help</param>
public Argument(string name) : base(name)
{
}
Expand Down
7 changes: 6 additions & 1 deletion src/System.CommandLine/Option.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ public abstract class Option : Symbol
internal AliasSet? _aliases;
private List<Action<OptionResult>>? _validators;

private protected Option(string name, string[] aliases) : base(name)
/// <summary>
/// Initializes a new instance of the <see cref="Option"/> class.
/// </summary>
/// <param name="name">The name of the option. This is used during parsing and is displayed in help.</param>
/// <param name="aliases">Optional aliases by which the option can be specified on the command line.</param>
protected Option(string name, string[] aliases) : base(name)
{
if (aliases is { Length: > 0 })
{
Expand Down
4 changes: 2 additions & 2 deletions src/System.CommandLine/Option{T}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class Option<T> : Option
/// <summary>
/// Initializes a new instance of the <see cref="Option"/> class.
/// </summary>
/// <param name="name">The name of the option. It's used for parsing, displaying Help and creating parse errors.</param>>
/// <param name="aliases">Optional aliases. Used for parsing, suggestions and displayed in Help.</param>
/// <param name="name">The name of the option. This is used during parsing and is displayed in help.</param>
/// <param name="aliases">Optional aliases by which the option can be specified on the command line.</param>
public Option(string name, params string[] aliases)
: this(name, aliases, new Argument<T>(name))
{
Expand Down