Skip to content
Open
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
15 changes: 14 additions & 1 deletion src/System.CommandLine/Argument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,21 @@ public ArgumentArity Arity
}

/// <summary>
/// The name used in help output to describe the argument.
/// Gets or sets the placeholder name shown in usage help for the argument's value.
/// The value will be wrapped in angle brackets (<c>&lt;</c> and <c>&gt;</c>).
/// </summary>
/// <remarks>
/// If <c>null</c>, the <see cref="Symbol.Name"/> of the argument will be used.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would <see langword="null"/> render as Nothing for Visual Basic?

/// </remarks>
/// <example>
/// An argument with <see cref="Symbol.Name"/> of <c>argument</c> and a
/// <see cref="HelpName"/> of <c>Value</c> will be shown in usage help as:
/// <c>&lt;Value&gt;</c>. If <see cref="HelpName"/> is not set,
/// help output will show: <c>&lt;argument&gt;</c>.
/// </example>
/// <value>
/// The name to show as the placeholder for the argument's value.
/// </value>
public string? HelpName { get; set; }

internal TryConvertArgument? ConvertArguments
Expand Down
4 changes: 4 additions & 0 deletions src/System.CommandLine/Completions/CompletionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ internal CompletionContext(ParseResult parseResult, string wordToComplete)
WordToComplete = wordToComplete;
}

/// <summary>
/// The text of the word to be completed, if any.
/// </summary>
public string WordToComplete { get; }

/// <summary>
/// The parse result for which completions are being requested.
/// </summary>
public ParseResult ParseResult { get; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/System.CommandLine/OptionValidation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static Option<FileSystemInfo> AcceptExistingOnly(this Option<FileSystemIn
}

/// <summary>
/// Configures an option to accept only values corresponding to a existing files or directories.
/// Configures an option to accept only values corresponding to existing files or directories.
/// </summary>
/// <param name="option">The option to configure.</param>
/// <returns>The option being extended.</returns>
Expand Down
9 changes: 6 additions & 3 deletions src/System.CommandLine/Parsing/SymbolResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ public IEnumerable<ParseError> Errors
public DirectiveResult? GetResult(Directive directive) => SymbolResultTree.GetResult(directive);

/// <summary>
/// Finds a result for a symbol having the specified name anywhere in the parse tree.
/// Finds a result for a <see cref="Symbol" /> having the specified <paramref name="name" /> anywhere in the parse tree.
/// </summary>
/// <param name="name">The name of the symbol for which to find a result.</param>
/// <returns>An argument result if the argument was matched by the parser or has a default value; otherwise, <c>null</c>.</returns>
/// <param name="name">The name of the <see cref="Symbol" /> for which to find a result.</param>
/// <returns>
/// A <see cref="SymbolResult" /> if the <see cref="Symbol" /> was matched by the parser or has a default value;
/// otherwise, <see langword="null" />.
/// </returns>
public SymbolResult? GetResult(string name) =>
SymbolResultTree.GetResult(name);

Expand Down
Loading