RootCommand Class
Definition
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 the main action that the application performs.
public ref class RootCommand : System::CommandLine::Command
public class RootCommand : System.CommandLine.Command
type RootCommand = class
inherit Command
Public Class RootCommand
Inherits Command
- Inheritance
Remarks
Use the RootCommand object without any subcommands for applications that perform one action. Add subcommands to the root for applications that require actions identified by specific strings. For example, `dir` does not use any subcommands. See Command for applications with multiple actions.
Constructors
RootCommand(String) |
Properties
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. (Inherited from Command) |
Children |
Gets the child symbols. (Inherited from Command) |
Description |
Gets or sets the description of the symbol. (Inherited from Symbol) |
ExecutableName |
The name of the currently running executable. |
ExecutablePath |
The path to the currently running executable. |
Handler |
Gets or sets the ICommandHandler for the command. The handler represents the action that will be performed when the command is invoked. (Inherited from Command) |
IsHidden |
Gets or sets a value indicating whether the symbol is hidden. (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. (Inherited from Command) |
Parents |
Gets the parent symbols. (Inherited from Symbol) |
Subcommands |
Represents all of the subcommands for the command. (Inherited from Command) |
TreatUnmatchedTokensAsErrors |
Gets or sets a value that indicates whether unmatched tokens should be treated as errors. For example,
if set to |
Methods
Add(Argument) |
Adds an Argument to the command. (Inherited from Command) |
Add(Command) |
Adds a subcommand to the command. (Inherited from Command) |
Add(Option) |
Adds an Option to the command. (Inherited from Command) |
AddAlias(String) |
Adds an alias. (Inherited from IdentifierSymbol) |
AddArgument(Argument) |
Adds an Argument to the command. (Inherited from Command) |
AddCommand(Command) |
Adds a subcommand to the command. (Inherited from Command) |
AddGlobalOption(Option) |
Adds a global Option to the command. (Inherited from Command) |
AddOption(Option) |
Adds an Option to the command. (Inherited from Command) |
AddValidator(ValidateSymbolResult<CommandResult>) |
Adds a custom validator to the command. Validators can be used to create custom validation logic. (Inherited from Command) |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetCompletions() |
Gets completions for the symbol. (Inherited from Symbol) |
GetCompletions(CompletionContext) |
Gets the suggested values for command line completion. (Inherited from Command) |
GetEnumerator() |
Gets an enumerator that represents all of the symbols for the command. (Inherited from Command) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
HasAlias(String) |
Determines whether the alias has already been defined. (Inherited from IdentifierSymbol) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Symbol) |
Explicit Interface Implementations
IEnumerable.GetEnumerator() |
Returns an enumerator that iterates through a collection. (Inherited from Command) |