public abstract class ParentCommand : ICommandWithCustomParsing,
ICommand, IAsyncCommand
Public MustInherit Class ParentCommand
Implements ICommandWithCustomParsing, ICommand, IAsyncCommand
Dim instance As ParentCommand
public ref class ParentCommand abstract : ICommandWithCustomParsing,
ICommand, IAsyncCommand
The ParentCommand class, along with the ParentCommandAttribute attribute, aid in easily creating applications that contain nested subcommands. This class handles finding, creating and running any nested subcommands, and handling parsing errors and printing usage help for those subcommands.
To utilize this class, derive a class from this class and apply the CommandAttribute attribute to that class. Then, apply the ParentCommandAttribute attribute to any child commands of this command.
Often, the derived class can be empty; however, you can override the members of this class to customize the behavior.
The ParentCommand class is based on the ICommandWithCustomParsing interface, so derived classes cannot define any arguments or use other functionality that depends on the CommandLineParser class.
ParentCommand | Initializes a new instance of the ParentCommand class |
FailureExitCode | Gets the exit code to return from the Run or RunAsync method if parsing command line arguments for a nested subcommand failed. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
OnAfterParsing | Function called after parsing, on success, cancellation, and failure. |
OnChildCommandNotFound | Method called when no nested subcommand name was specified, or the nested subcommand could not be found. |
OnDuplicateArgumentWarning | Method called when the ParseOptionsDuplicateArguments property is set to ErrorModeWarning and a duplicate argument value was encountered. |
OnModifyOptions | Allows derived classes to customize the command and parse options used for the nested subcommands. |
Parse | Parses the arguments for the command, locating and instantiating a child command. |
Run | Runs the child command that was instantiated by the Parse(ReadOnlyMemoryString, CommandManager) method. |
RunAsync | Runs the child command that was instantiated by the Parse(ReadOnlyMemoryString, CommandManager) method asynchronously. |
ToString | Returns a string that represents the current object. (Inherited from Object) |