From e8560b67f25e3d2e49d95b63e00eebe5074c2b64 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 27 Jan 2020 11:09:14 +0100 Subject: [PATCH] src/api/cli/command.rs - handle_nested_command: fix help output --- proxmox/src/api/cli/command.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxmox/src/api/cli/command.rs b/proxmox/src/api/cli/command.rs index 2048e100..81ce36aa 100644 --- a/proxmox/src/api/cli/command.rs +++ b/proxmox/src/api/cli/command.rs @@ -94,7 +94,7 @@ async fn handle_nested_command( // Note: Avoid async recursive function, because current rust compiler cant handle that loop { if args.is_empty() { - let mut cmds: Vec<&String> = def.commands.keys().collect(); + let mut cmds: Vec<&String> = map.commands.keys().collect(); cmds.sort(); let list = cmds.iter().fold(String::new(), |mut s, item| { @@ -106,7 +106,7 @@ async fn handle_nested_command( }); let err_msg = format!("no command specified.\nPossible commands: {}", list); - print_nested_usage_error(&prefix, def, &err_msg); + print_nested_usage_error(&prefix, map, &err_msg); return Err(format_err!("{}", err_msg)); } @@ -116,7 +116,7 @@ async fn handle_nested_command( Some(cmd) => cmd, None => { let err_msg = format!("no such command '{}'", command); - print_nested_usage_error(&prefix, def, &err_msg); + print_nested_usage_error(&prefix, map, &err_msg); return Err(format_err!("{}", err_msg)); } };