Skip to content
Merged
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
16 changes: 13 additions & 3 deletions src/System.CommandLine/Option.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,22 @@ protected Option(string name, string[] aliases) : base(name)
public bool HasDefaultValue => Argument.HasDefaultValue;

/// <summary>
/// Gets or sets the name of the Option when displayed in help.
/// Gets or sets the placeholder name shown in usage help for the option'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 option will be used,
/// with leading dashes and slashes removed.
/// </remarks>
/// <example>
/// An option with <see cref="Symbol.Name"/> of <c>--option</c> and a
/// <see cref="HelpName"/> of <c>Value</c> will be shown in usage help as:
/// <c>--option &lt;Value&gt;</c>. If <see cref="HelpName"/> is not set,
/// help output will show: <c>--option &lt;option&gt;</c>.
/// </example>
/// <value>
/// The name of the option when displayed in help.
/// The name to show as the placeholder for the option's value.
/// </value>
/// <remarks>Useful for localization, as it's not used for actual parsing.</remarks>
public string? HelpName
{
get => Argument.HelpName;
Expand Down