formatting fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
6d152f8930
commit
f1fcdff9a3
@ -107,11 +107,7 @@ impl CliCommandMap {
|
||||
}
|
||||
|
||||
/// Insert another command.
|
||||
pub fn insert<C: Into<CommandLineInterface>>(
|
||||
mut self,
|
||||
name: &'static str,
|
||||
cli: C,
|
||||
) -> Self {
|
||||
pub fn insert<C: Into<CommandLineInterface>>(mut self, name: &'static str, cli: C) -> Self {
|
||||
self.commands.insert(name.into(), cli.into());
|
||||
self
|
||||
}
|
||||
|
@ -212,7 +212,6 @@ pub fn handle_command(
|
||||
/// - ``printdoc``: Output ReST documentation.
|
||||
///
|
||||
pub fn run_cli_command<C: Into<CommandLineInterface>>(def: C) {
|
||||
|
||||
let def = match def.into() {
|
||||
CommandLineInterface::Simple(cli_cmd) => CommandLineInterface::Simple(cli_cmd),
|
||||
CommandLineInterface::Nested(map) => CommandLineInterface::Nested(map.insert_help()),
|
||||
|
@ -337,13 +337,11 @@ mod test {
|
||||
.insert("l0c1", CliCommand::new(&API_METHOD_SIMPLE1))
|
||||
.insert(
|
||||
"l0c2",
|
||||
CliCommand::new(&API_METHOD_SIMPLE1)
|
||||
.arg_param(&["required-arg"])
|
||||
CliCommand::new(&API_METHOD_SIMPLE1).arg_param(&["required-arg"]),
|
||||
)
|
||||
.insert(
|
||||
"l0c3",
|
||||
CliCommand::new(&API_METHOD_SIMPLE1)
|
||||
.arg_param(&["required-arg", "optional-arg"])
|
||||
CliCommand::new(&API_METHOD_SIMPLE1).arg_param(&["required-arg", "optional-arg"]),
|
||||
);
|
||||
|
||||
cmd_def.into()
|
||||
|
Loading…
x
Reference in New Issue
Block a user