Struct commands::parser::Command [] [src]

pub struct Command<'a> {
    // some fields omitted
}

Description of a command to be added to the CommandTree.

The lifetime parameter 'a refers to the lifetime of the strings used for command names and help text.

Methods

impl<'a> Command<'a>

fn new(name: &'a str) -> Self

Construct a default (blank) command with the given name.

fn hidden(self, hidden: bool) -> Self

Mark the command as hidden. Hidden commands will match within the parser, but are not listed during completion.

fn priority(self, priority: i32) -> Self

Give the command a priority. This is used when sorting out conflicts during matching and completion.

This is not commonly needed.

fn help(self, help_text: &'a str) -> Self

Supply help text for the command.

fn parameter(self, parameter: Parameter<'a>) -> Self

Add a Parameter to the command.

fn wraps(self, wrapped_root: String) -> Self

The wrapped_root signifies the path to the command that should be wrapped by this command. This is used for the help command.