5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-02-25 21:57:42 +03:00

cli: only show subcommand specific usage if command incomplete

before:
$ pveum acl
ERROR: incomplete command 'pveum acl'
USAGE: pveum <COMMAND> [ARGS] [OPTIONS]
       pveum acl delete <path> --roles <string> [OPTIONS]
       pveum acl modify <path> --roles <string> [OPTIONS]

       pveum group add <groupid> [OPTIONS]
       pveum group delete <groupid>
       pveum group modify <groupid> [OPTIONS]

       pveum role add <roleid> [OPTIONS]
       pveum role delete <roleid>
       pveum role modify <roleid> --privs <string> [OPTIONS]

       pveum user add <userid> [OPTIONS]
       pveum user delete <userid>
       pveum user modify <userid> [OPTIONS]

       pveum passwd <userid>
       pveum ticket <username> [OPTIONS]

       pveum help [<extra-args>] [OPTIONS]

after:
$ pveum acl
ERROR: incomplete command 'pveum acl'
USAGE: pveum <COMMAND> [ARGS] [OPTIONS]
       pveum acl delete <path> --roles <string> [OPTIONS]
       pveum acl modify <path> --roles <string> [OPTIONS]

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2018-06-13 09:37:51 +02:00 committed by Wolfgang Bumiller
parent 0b79680694
commit 131f316b5c

View File

@ -491,7 +491,7 @@ my $handle_cmd = sub {
} }
# checked special commands, if def is still a hash we got an incomplete sub command # checked special commands, if def is still a hash we got an incomplete sub command
$abort->("incomplete command '$cmd_str'") if ref($def) eq 'HASH'; $abort->("incomplete command '$cmd_str'", $args) if ref($def) eq 'HASH';
&$preparefunc() if $preparefunc; &$preparefunc() if $preparefunc;