src/cli/command.rs: implement help

This commit is contained in:
Dietmar Maurer committed 2019-11-30 13:02:00 +01:00
1 parent 8423c1fe64
commit 1201abcffa
3 files changed
+89 -33

No files matched your search

+2 -9
View File
@@ -37,7 +37,6 @@ fn command_map() -> CliCommandMap {
cmd_def
}
fn main() -> Result<(), Error> {
let def = CommandLineInterface::Nested(command_map());
@@ -58,14 +57,8 @@ fn main() -> Result<(), Error> {
let args = shellword_split(&line)?;
let def = helper.cmd_def();
let _ = match def {
CommandLineInterface::Simple(ref cli_cmd) => {
handle_simple_command(def, "", &cli_cmd, args)
}
CommandLineInterface::Nested(ref map) => {
handle_nested_command(def, "", &map, args)
}
};
handle_command(def, "", args);
}
Ok(())