Struct shi::command::parent::ParentCommand [−][src]
pub struct ParentCommand<'a, S> { /* fields omitted */ }
Expand description
ParentCommand represents a command with subcommands. It has a name, but it does not execute anything itself. It dispatches to the appropriate child command, if one exists.
Implementations
Creates a new ParentCommand.
Arguments
name
- The name of this command.
sub_cmds
- The subcommands or children of the ParentCommand
to be created.
pub fn new_with_help(
name: &'a str,
help: &'a str,
sub_cmds: Vec<Command<'a, S>>
) -> ParentCommand<'a, S>
pub fn new_with_help(
name: &'a str,
help: &'a str,
sub_cmds: Vec<Command<'a, S>>
) -> ParentCommand<'a, S>
Creates a new ParentCommand with the given help message.
Arguments
name
- The name of this command.
sub_cmds
- The subcommands or children of the ParentCommand
to be created.
Returns a CommandSet
of the child commands under this ParentCommand
.
Trait Implementations
type State = S
type State = S
The State of the command. Expected to be bound to a containing Shell
.
Returns the name of the command. This is equivalent to how the command would be invoked.
Validates the given arguments, returning a Result<()>
indicating the result of
validation. Read more
Executes the command. Read more
Returns a String representing the help text of this command. By default, returns nothing. Read more
Autocompletes a command, given arguments. Read more