Command

Trait Command 

Source
pub trait Command {
    // Required methods
    fn name<'a>(&self) -> &'a str;
    fn help<'a>(&self) -> &'a str;
    fn description<'a>(&self) -> &'a str;
    fn run(&self, argv: &Vec<String>);
}
Expand description

This trait must be implemented for each subcommand

Required Methods§

Source

fn name<'a>(&self) -> &'a str

This fonction must return the command line, without space. Like build, clean, …

Source

fn help<'a>(&self) -> &'a str

Return the help message of a subcommand. Used for bin help subcommand

Source

fn description<'a>(&self) -> &'a str

Return a one line description. Used for the program help bin -h

Source

fn run(&self, argv: &Vec<String>)

Main entry point. argv contains all argument passed to the binary, with the program name in argv[0]

Implementors§