From c9cec98eceb5d4d072164ae7ff46d750d03e6448 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 6 Dec 2019 10:13:12 +0100 Subject: [PATCH] proxmox-api/src/cli/format.rs - generate_nested_usage: fix formating with empty prefix --- proxmox-api/src/cli/format.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxmox-api/src/cli/format.rs b/proxmox-api/src/cli/format.rs index 11df87f5..a83c754e 100644 --- a/proxmox-api/src/cli/format.rs +++ b/proxmox-api/src/cli/format.rs @@ -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) => {