Skip to content

Commit e2235f5

Browse files
authored
Merge branch 'main' into merge/release/10.0-to-main
2 parents ef926c4 + 864756d commit e2235f5

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

eng/Version.Details.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
3-
<Source Uri="https://github.com/dotnet/dotnet" Mapping="command-line-api" Sha="f8a57b66e6466922534e8046b37a6503d9d39dab" BarId="279432" />
3+
<Source Uri="https://github.com/dotnet/dotnet" Mapping="command-line-api" Sha="5c3434d8b831745673c31e186906f463e1036301" BarId="279843" />
44
<ProductDependencies>
55
</ProductDependencies>
66
<ToolsetDependencies>

src/System.CommandLine/Option.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,22 @@ protected Option(string name, string[] aliases) : base(name)
4141
public bool HasDefaultValue => Argument.HasDefaultValue;
4242

4343
/// <summary>
44-
/// Gets or sets the name of the Option when displayed in help.
44+
/// Gets or sets the placeholder name shown in usage help for the option's value.
45+
/// The value will be wrapped in angle brackets (<c>&lt;</c> and <c>&gt;</c>).
4546
/// </summary>
47+
/// <remarks>
48+
/// If <c>null</c>, the <see cref="Symbol.Name"/> of the option will be used,
49+
/// with leading dashes and slashes removed.
50+
/// </remarks>
51+
/// <example>
52+
/// An option with <see cref="Symbol.Name"/> of <c>--option</c> and a
53+
/// <see cref="HelpName"/> of <c>Value</c> will be shown in usage help as:
54+
/// <c>--option &lt;Value&gt;</c>. If <see cref="HelpName"/> is not set,
55+
/// help output will show: <c>--option &lt;option&gt;</c>.
56+
/// </example>
4657
/// <value>
47-
/// The name of the option when displayed in help.
58+
/// The name to show as the placeholder for the option's value.
4859
/// </value>
49-
/// <remarks>Useful for localization, as it's not used for actual parsing.</remarks>
5060
public string? HelpName
5161
{
5262
get => Argument.HelpName;

0 commit comments

Comments
 (0)