mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +00:00
80 lines
2.3 KiB
Plaintext
80 lines
2.3 KiB
Plaintext
|
#compdef balena
|
||
|
#autoload
|
||
|
|
||
|
#GENERATED FILE DON'T MODIFY#
|
||
|
|
||
|
_balena() {
|
||
|
typeset -A opt_args
|
||
|
local context state line curcontext="$curcontext"
|
||
|
|
||
|
# Valid top-level completions
|
||
|
main_commands=( apps build deploy envs join keys leave login logout logs note orgs preload push scan settings ssh support tags tunnel version whoami api-key app app config device device devices env internal key key local os tag util )
|
||
|
# Sub-completions
|
||
|
api_key_cmds=( generate )
|
||
|
app_cmds=( create purge rename restart rm )
|
||
|
config_cmds=( generate inject read reconfigure write )
|
||
|
device_cmds=( deactivate identify init local-mode move os-update public-url purge reboot register rename restart rm shutdown )
|
||
|
devices_cmds=( supported )
|
||
|
env_cmds=( add rename rm )
|
||
|
internal_cmds=( osinit )
|
||
|
key_cmds=( add rm )
|
||
|
local_cmds=( configure flash )
|
||
|
os_cmds=( build-config configure download initialize versions )
|
||
|
tag_cmds=( rm set )
|
||
|
|
||
|
|
||
|
_arguments -C \
|
||
|
'(- 1 *)--version[show version and exit]' \
|
||
|
'(- 1 *)'{-h,--help}'[show help options and exit]' \
|
||
|
'1:first command:_balena_main_cmds' \
|
||
|
'2:second command:_balena_sec_cmds' \
|
||
|
&& ret=0
|
||
|
}
|
||
|
|
||
|
(( $+functions[_balena_main_cmds] )) ||
|
||
|
_balena_main_cmds() {
|
||
|
_describe -t main_commands 'command' main_commands "$@" && ret=0
|
||
|
}
|
||
|
|
||
|
(( $+functions[_balena_sec_cmds] )) ||
|
||
|
_balena_sec_cmds() {
|
||
|
case $line[1] in
|
||
|
"api-key")
|
||
|
_describe -t api_key_cmds 'api-key_cmd' api_key_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"app")
|
||
|
_describe -t app_cmds 'app_cmd' app_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"config")
|
||
|
_describe -t config_cmds 'config_cmd' config_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"device")
|
||
|
_describe -t device_cmds 'device_cmd' device_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"devices")
|
||
|
_describe -t devices_cmds 'devices_cmd' devices_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"env")
|
||
|
_describe -t env_cmds 'env_cmd' env_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"internal")
|
||
|
_describe -t internal_cmds 'internal_cmd' internal_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"key")
|
||
|
_describe -t key_cmds 'key_cmd' key_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"local")
|
||
|
_describe -t local_cmds 'local_cmd' local_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"os")
|
||
|
_describe -t os_cmds 'os_cmd' os_cmds "$@" && ret=0
|
||
|
;;
|
||
|
"tag")
|
||
|
_describe -t tag_cmds 'tag_cmd' tag_cmds "$@" && ret=0
|
||
|
;;
|
||
|
|
||
|
esac
|
||
|
}
|
||
|
|
||
|
_balena "$@"
|