Skip to content

Commit 70d72f0

Browse files
tdykstragewarren
andauthored
Apply comments from #7859 (#1701)
* Apply comments from #7859 * Update src/System.CommandLine/Parsing/Parser.cs Co-authored-by: Genevieve Warren <[email protected]> * add builder param Co-authored-by: Genevieve Warren <[email protected]>
1 parent ce54d76 commit 70d72f0

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/System.CommandLine/Builder/CommandLineBuilderExtensions.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ public static CommandLineBuilder CancelOnProcessTermination(this CommandLineBuil
100100
/// Enables the parser to recognize command line directives.
101101
/// </summary>
102102
/// <param name="builder">A command line builder.</param>
103-
/// <param name="value">If set to <see langword="true"/>, then directives are enabled. Otherwise, they are parsed like any other token.</param>
103+
/// <param name="value"><see langword="true" /> to enable directives. <see langword="false" /> to parse directive-like tokens in the same way as any other token.</param>
104104
/// <returns>The same instance of <see cref="CommandLineBuilder"/>.</returns>
105+
/// <seealso href="/dotnet/standard/commandline/syntax#directives">Command-line directives</seealso>
105106
/// <seealso cref="DirectiveCollection"/>
106107
public static CommandLineBuilder EnableDirectives(
107108
this CommandLineBuilder builder,
@@ -114,7 +115,8 @@ public static CommandLineBuilder EnableDirectives(
114115
/// <summary>
115116
/// Determines the behavior when parsing a double dash (<c>--</c>) in a command line.
116117
/// </summary>
117-
/// <remarks>When set to <see langword="true"/>, all tokens following <c>--</c> will be placed into the <see cref="ParseResult.UnparsedTokens"/> collection. When set to <see langword="false"/>, all tokens following <c>--</c> will be treated as command arguments, even if they match an existing option.</remarks>
118+
/// <param name="builder">A command line builder.</param>
119+
/// <param name="value"><see langword="true" /> to place all tokens following <c>--</c> into the <see cref="ParseResult.UnparsedTokens"/> collection. <see langword="false" /> to treat all tokens following <c>--</c> as command arguments, even if they match an existing option.</param>
118120
public static CommandLineBuilder EnableLegacyDoubleDashBehavior(
119121
this CommandLineBuilder builder,
120122
bool value = true)
@@ -127,7 +129,7 @@ public static CommandLineBuilder EnableLegacyDoubleDashBehavior(
127129
/// Enables the parser to recognize and expand POSIX-style bundled options.
128130
/// </summary>
129131
/// <param name="builder">A command line builder.</param>
130-
/// <param name="value">If set to <see langword="true"/>, then POSIX bundles are parsed. ; otherwise, <see langword="false"/>.</param>
132+
/// <param name="value"><see langword="true"/> to parse POSIX bundles; otherwise, <see langword="false"/>.</param>
131133
/// <returns>The same instance of <see cref="CommandLineBuilder"/>.</returns>
132134
/// <remarks>
133135
/// POSIX conventions recommend that single-character options be allowed to be specified together after a single <c>-</c> prefix. When <see cref="EnablePosixBundling"/> is set to <see langword="true"/>, the following command lines are equivalent:

src/System.CommandLine/IdentifierSymbol.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@ public override string Name
6060
}
6161

6262
/// <summary>
63-
/// Adds an alias. Multiple aliases can be added, most often used to provide a shorthand alternative.
63+
/// Adds an <see href="/dotnet/standard/commandline/syntax#aliases">alias</see>.
6464
/// </summary>
6565
/// <param name="alias">The alias to add.</param>
66+
/// <remarks>
67+
/// You can add multiple aliases for a symbol.
68+
/// </remarks>
6669
public void AddAlias(string alias)
6770
{
6871
ThrowIfAliasIsInvalid(alias);
@@ -73,10 +76,10 @@ public void AddAlias(string alias)
7376
private protected virtual void RemoveAlias(string alias) => _aliases.Remove(alias);
7477

7578
/// <summary>
76-
/// Determines whether the alias has already been defined.
79+
/// Determines whether the specified alias has already been defined.
7780
/// </summary>
7881
/// <param name="alias">The alias to search for.</param>
79-
/// <returns><see langword="true">true</see> if the alias has already been defined; otherwise <see langkeyword="true">false</see>.</returns>
82+
/// <returns><see langword="true" /> if the alias has already been defined; otherwise <see langword="false" />.</returns>
8083
public bool HasAlias(string alias) => _aliases.Contains(alias);
8184

8285
[DebuggerStepThrough]

src/System.CommandLine/Parsing/Parser.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ public Parser(Command command) : this(new CommandLineConfiguration(command))
2323
}
2424

2525
/// <summary>
26-
/// Initializes a new instance of the Parser class with using the default <seealso cref="RootCommand"/>.
26+
/// Initializes a new instance of the <see cref="Parser" /> class using the default <see cref="RootCommand" />.
2727
/// </summary>
2828
public Parser() : this(new RootCommand())
2929
{
3030
}
3131

3232
/// <summary>
33-
/// The configuration on which the parser's grammar and behaviors are based.
33+
/// Gets the configuration on which the parser's grammar and behaviors are based.
3434
/// </summary>
3535
public CommandLineConfiguration Configuration { get; }
3636

3737
/// <summary>
3838
/// Parses a list of arguments.
3939
/// </summary>
4040
/// <param name="arguments">The string array typically passed to a program's <c>Main</c> method.</param>
41-
/// <param name="rawInput">Holds the value of a complete command line input prior to splitting and tokenization, when provided. This will typically not be available when the parser is called from <c>Program.Main</c>. It is primarily used when calculating completions via the <c>dotnet-suggest</c> tool.</param>
41+
/// <param name="rawInput">The complete command line input prior to splitting and tokenization. This input is not typically available when the parser is called from <c>Program.Main</c>. It is primarily used when calculating completions via the <c>dotnet-suggest</c> tool.</param>
4242
/// <returns>A <see cref="ParseResult"/> providing details about the parse operation.</returns>
4343
public ParseResult Parse(
4444
IReadOnlyList<string> arguments,

0 commit comments

Comments
 (0)