Struct subcmd::CmdHandler
[−]
[src]
pub struct CmdHandler<'a> { /* fields omitted */ }
Command line parser and subcommand runner
Example
use subcmd::CmdHandler; let mut handler = CmdHandler::new(); // Add your custom command here // handler.add(Box::new(MyCommand)); // handler.add(Box::new(AnotherCommand)); handler.run(); // Run main logic
Methods
impl<'a> CmdHandler<'a>
[src]
fn new() -> CmdHandler<'a>
Create a new CmdHandler
fn set_description(&mut self, descr: &'a str)
Set a one line description, used in bin --help
fn get_description(&mut self) -> &'a str
Get the program description
fn override_args(&mut self, args: Vec<String>)
Override default args
fn add(&mut self, command: Box<Command>)
Register a new subcommand
fn run(self) -> CmdResult
Run the main logic