proxmox-api/src/cli/format.rs - generate_nested_usage: fix formating with empty prefix

This commit is contained in:
Dietmar Maurer 2019-12-06 10:13:12 +01:00
parent d00a096851
commit c9cec98ece

View File

@ -172,7 +172,11 @@ pub fn generate_nested_usage(
let mut usage = String::new();
for cmd in cmds {
let new_prefix = format!("{} {}", prefix, cmd);
let new_prefix = if prefix.is_empty() {
String::from(cmd)
} else {
format!("{} {}", prefix, cmd)
};
match def.commands.get(cmd).unwrap() {
CommandLineInterface::Simple(cli_cmd) => {