| 1 |
#compdef storagectl |
| 2 |
# SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 |
|
| 4 |
(( $+functions[_storagectl_commands] )) || _storagectl_commands() |
| 5 |
{ |
| 6 |
local -a _storagectl_cmds |
| 7 |
_storagectl_cmds=( |
| 8 |
"volumes:List storage volumes" |
| 9 |
"templates:List storage volume templates" |
| 10 |
"providers:List storage providers" |
| 11 |
"help:Prints a short help text and exits" |
| 12 |
) |
| 13 |
if (( CURRENT == 1 )); then |
| 14 |
_describe -t commands 'storagectl command' _storagectl_cmds |
| 15 |
else |
| 16 |
local curcontext="$curcontext" |
| 17 |
cmd="${${_storagectl_cmds[(r)$words[1]:*]%%:*}}" |
| 18 |
if (( $+functions[_storagectl_$cmd] )); then |
| 19 |
_storagectl_$cmd |
| 20 |
else |
| 21 |
_message "no more options" |
| 22 |
fi |
| 23 |
fi |
| 24 |
} |
| 25 |
|
| 26 |
_arguments \ |
| 27 |
'(- *)'{-h,--help}'[Prints a short help text and exits.]' \ |
| 28 |
'(- *)--version[Prints a short version string and exits.]' \ |
| 29 |
'--no-pager[Do not pipe output into a pager]' \ |
| 30 |
'--no-legend[Do not show the headers and footers]' \ |
| 31 |
'--no-ask-password[Do not query the user for authentication]' \ |
| 32 |
'--json=[Show output as JSON]:mode:(pretty short off help)' \ |
| 33 |
'--system[Operate in system mode]' \ |
| 34 |
'--user[Operate in user mode]' \ |
| 35 |
'*::storagectl command:_storagectl_commands' |