Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a specific action that the application performs.
public ref class Command : System::CommandLine::Symbol, System::Collections::IEnumerable
public ref class Command : System::CommandLine::IdentifierSymbol, System::Collections::Generic::IEnumerable<System::CommandLine::Symbol ^>
public class Command : System.CommandLine.Symbol, System.Collections.IEnumerable
public class Command : System.CommandLine.IdentifierSymbol, System.Collections.Generic.IEnumerable<System.CommandLine.Symbol>
type Command = class
inherit Symbol
interface IEnumerable
type Command = class
inherit IdentifierSymbol
interface seq<Symbol>
interface IEnumerable
Public Class Command
Inherits Symbol
Implements IEnumerable
Public Class Command
Inherits IdentifierSymbol
Implements IEnumerable(Of Symbol)
Use the Command object for actions that correspond to a specific string (the command name). See RootCommand for simple applications that only have one action. For example, dotnet run
uses run
as the command.
Command(String, String) |
Initializes a new instance of the Command class. |
Action | |
Aliases | |
Aliases |
Gets the set of strings that can be used on the command line to specify the symbol. (Inherited from IdentifierSymbol) |
Arguments |
Represents all of the arguments for the command. |
Children |
Gets the child symbols. |
Description |
Gets or sets the description of the symbol. (Inherited from Symbol) |
Handler |
Gets or sets the ICommandHandler for the command. The handler represents the action that will be performed when the command is invoked. |
Hidden | (Inherited from Symbol) |
Is |
Gets or sets a value indicating whether the symbol is hidden. (Inherited from Symbol) |
Name |
Gets or sets the name of the symbol. (Inherited from Symbol) |
Name |
Gets or sets the symbol name. (Inherited from IdentifierSymbol) |
Options |
Represents all of the options for the command, including global options that have been applied to any of the command's ancestors. |
Parents |
Gets the parent symbols. (Inherited from Symbol) |
Subcommands |
Represents all of the subcommands for the command. |
Treat |
Gets or sets a value that indicates whether unmatched tokens should be treated as errors. For example,
if set to |
Validators |
IEnumerable. |
Returns an enumerator that iterates through a collection. |
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in