Struct subcmd::Handler [] [src]

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

Command line parser and subcommand runner

Example

let mut handler = Handler::new();

// Add your custom command
handler.add(Box::new(MyCommand));
handler.add(Box::new(AnotherCommand));

handler.run(); // Run main logic

Methods

impl<'a> Handler<'a>
[src]

fn new() -> Handler<'a>

Create a new Handler

fn set_description(&mut self, descr: &'a str)

Set a one line description, used in bin --help

fn add(&mut self, command: Box<Command>)

Register a new subcommand

fn run(&mut self)

Main logic

This function retrieve argv, parse-it and run the corresponding subcommand

fn run_with_args(&mut self, args: &Vec<String>)

Run the main logic without auto retrieving of argv