use kinetic::KineticResult;
use std::ascii::OwnedAsciiExt;
#[derive(RustcDecodable, Debug)]
pub struct HelpArgs {
flag_verbose: bool,
arg_command: ::main::Command,
}
static USAGE: &'static str = "
Show help for a command
Usage: kinetic-rust help [options] <command>
kinetic-rust help (-h | --help)
Options:
-h, --help Print this message
-v, --verbose Use verbose output
";
fn execute(cmd: &HelpArgs, shell: &mut ::shell::MultiShell) -> KineticResult<()> {
shell.set_verbose(cmd.flag_verbose);
let argv = ["kinetic-rust".to_string(),
format!("{:?}", cmd.arg_command).into_ascii_lowercase(),
"-h".to_string()];
::main::main_with_args(&argv, shell) }
impl ::cli::CliCommand for HelpArgs {
fn from_argv(argv: ::std::vec::Vec<String>) -> HelpArgs {
::docopt::Docopt::new(::cli::CliCommand::usage(None::<HelpArgs>))
.and_then(|d| d.argv(argv.clone().into_iter()).decode() )
.unwrap_or_else(|e| e.exit())
}
#[inline]
fn execute(&self, shell: &mut ::shell::MultiShell) -> ::kinetic::KineticResult<()> {
execute(self, shell)
}
#[inline]
fn usage(_: Option<HelpArgs>) -> &'static str { USAGE }
}