diff --git a/src/System.CommandLine/Argument.cs b/src/System.CommandLine/Argument.cs index f1c915045e..af2937f055 100644 --- a/src/System.CommandLine/Argument.cs +++ b/src/System.CommandLine/Argument.cs @@ -10,7 +10,7 @@ namespace System.CommandLine { /// - /// A symbol defining a value that can be passed on the command line to a command or option. + /// Represents a symbol that defines a value that can be passed on the command line to a command or option. /// public abstract class Argument : Symbol { @@ -22,7 +22,7 @@ public abstract class Argument : Symbol /// /// Initializes a new instance of the Argument class. /// - /// The name of the argument. This can be used to look up the parsed value and is displayed in help + /// The name of the argument. This value can be used to look up the parsed value and is displayed in help if is null. protected Argument(string name) : base(name, allowWhitespace: true) { } @@ -48,8 +48,11 @@ public ArgumentArity Arity /// Gets or sets the placeholder name shown in usage help for the argument's value. /// The value will be wrapped in angle brackets (< and >). /// + /// + /// The name to show as the placeholder for the argument's value. + /// /// - /// If null, the of the argument will be used. + /// If null, the of the argument is used. /// /// /// An argument with of argument and a @@ -57,9 +60,6 @@ public ArgumentArity Arity /// <Value>. If is not set, /// help output will show: <argument>. /// - /// - /// The name to show as the placeholder for the argument's value. - /// public string? HelpName { get; set; } internal TryConvertArgument? ConvertArguments @@ -107,12 +107,12 @@ public List>> CompletionSour } /// - /// Gets or sets the that the argument's parsed tokens will be converted to. + /// Gets the type that the argument's parsed tokens will be converted to. /// public abstract Type ValueType { get; } /// - /// Provides a list of argument validators. Validators can be used + /// Gets a list of argument validators. Validators can be used /// to provide custom errors based on user input. /// public List> Validators => _validators ??= new (); @@ -122,7 +122,7 @@ public List>> CompletionSour /// /// Gets the default value for the argument. /// - /// Returns the default value for the argument, if defined. Null otherwise. + /// The default value for the argument, if defined; otherwise, . public object? GetDefaultValue() { var command = Parents.FlattenBreadthFirst(x => x.Parents) @@ -135,7 +135,7 @@ public List>> CompletionSour internal abstract object? GetDefaultValue(ArgumentResult argumentResult); /// - /// Specifies if a default value is defined for the argument. + /// Gets a value that indicates if a default value is defined for the argument. /// public abstract bool HasDefaultValue { get; } diff --git a/src/System.CommandLine/Argument{T}.cs b/src/System.CommandLine/Argument{T}.cs index 2a9dd55592..999ac5604f 100644 --- a/src/System.CommandLine/Argument{T}.cs +++ b/src/System.CommandLine/Argument{T}.cs @@ -15,17 +15,17 @@ public class Argument : Argument /// /// Initializes a new instance of the Argument class. /// - /// The name of the argument. This can be used to look up the parsed value and is displayed in help + /// The name of the argument. This name can be used to look up the parsed value and is displayed in help. public Argument(string name) : base(name) { } /// - /// The delegate to invoke to create the default value. + /// Gets or sets the delegate to invoke to create the default value. /// /// - /// It's invoked when there was no parse input provided for given Argument. - /// The same instance can be set as , in such case + /// This delegate is invoked when there was no parse input provided for given Argument. + /// The same instance can be set as . In that case, /// the delegate is also invoked when an input was provided. /// public Func? DefaultValueFactory @@ -45,11 +45,11 @@ public Func? DefaultValueFactory } /// - /// A custom argument parser. + /// Gets or sets a custom argument parser. /// /// - /// It's invoked when there was parse input provided for given Argument. - /// The same instance can be set as , in such case + /// The custom parser is invoked when there was parse input provided for a given Argument. + /// The same instance can be set as ; in that case, /// the delegate is also invoked when no input was provided. /// public Func? CustomParser diff --git a/src/System.CommandLine/Command.cs b/src/System.CommandLine/Command.cs index be565651d2..a44f9789e0 100644 --- a/src/System.CommandLine/Command.cs +++ b/src/System.CommandLine/Command.cs @@ -18,9 +18,9 @@ namespace System.CommandLine /// Represents a specific action that the application performs. /// /// - /// Use the Command object for actions that correspond to a specific string (the command name). See - /// for simple applications that only have one action. For example, dotnet run - /// uses run as the command. + /// Use the Command object for actions that correspond to a specific string (the command name). + /// For simple applications that only have one action, see . + /// For example, dotnet run uses run as the command. /// public class Command : Symbol, IEnumerable { @@ -57,28 +57,31 @@ public IEnumerable Children } /// - /// Represents all of the arguments for the command. + /// Gets all of the arguments for the command. /// public IList Arguments => _arguments ??= new(this); internal bool HasArguments => _arguments?.Count > 0 ; /// - /// Represents all of the options for the command, inherited options that have been applied to any of the command's ancestors. + /// Gets all of the options for the command. /// + /// + /// This collection doesn't include options on parent commands where Option.Recursive is . Those options are valid under the current command but don't appear in this collection. + /// public IList