[pve-devel] [pve-common] generate_usage_str: do not group sub-commands
Dietmar Maurer
dietmar at proxmox.com
Tue Jul 31 10:38:46 CEST 2018
Usually, sub commands already form a logical group, so further grouping
just adds confusion (see 'qm' as example)
Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
src/PVE/CLIHandler.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm
index 5c0671f..13904e2 100644
--- a/src/PVE/CLIHandler.pm
+++ b/src/PVE/CLIHandler.pm
@@ -217,7 +217,7 @@ sub generate_usage_str {
} else {
next if $def->{$cmd}->{alias};
- my $substr = $generate->($indent, $separator, $def->{$cmd}, "$prefix $cmd");
+ my $substr = $generate->($indent, '', $def->{$cmd}, "$prefix $cmd");
if ($substr) {
$substr .= $separator if $substr !~ /\Q$separator\E{2}/;
$str .= $substr;
@@ -335,7 +335,7 @@ sub print_usage_short {
$assert_initialized->();
print $fd "ERROR: $msg\n" if $msg;
- print $fd "USAGE: $exename <COMMAND> [ARGS] [OPTIONS]\n";
+ print $fd "USAGE: $exename <COMMAND> [ARGS] [OPTIONS]\n\n";
print {$fd} generate_usage_str('short', $cmd, ' ' x 7, "\n", sub {
my ($h) = @_;
--
2.11.0
More information about the pve-devel
mailing list