2018-03-02 19:50:14 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-02-28 20:40:25 +00:00
|
|
|
#GENERATED FILE DON'T MODIFY#
|
|
|
|
|
2018-10-19 14:38:50 +00:00
|
|
|
_balena_complete()
|
2018-03-02 19:50:14 +00:00
|
|
|
{
|
|
|
|
local cur prev
|
|
|
|
|
|
|
|
# Valid top-level completions
|
2023-05-25 15:59:27 +00:00
|
|
|
main_commands="build deploy envs fleets join keys leave login logout logs note orgs preload push releases scan settings ssh support tags tunnel version whoami api-key api-keys app block config device device devices env fleet fleet internal key key local os release release tag util"
|
2018-03-02 19:50:14 +00:00
|
|
|
# Sub-completions
|
2023-05-24 18:50:08 +00:00
|
|
|
api_key_cmds="generate revoke"
|
2023-05-25 15:05:47 +00:00
|
|
|
app_cmds="create"
|
2023-05-25 15:59:27 +00:00
|
|
|
block_cmds="create"
|
2018-03-02 19:50:14 +00:00
|
|
|
config_cmds="generate inject read reconfigure write"
|
2022-06-17 14:46:46 +00:00
|
|
|
device_cmds="deactivate identify init local-mode move os-update pin public-url purge reboot register rename restart rm shutdown track-fleet"
|
2021-02-28 20:40:25 +00:00
|
|
|
devices_cmds="supported"
|
2018-03-02 19:50:14 +00:00
|
|
|
env_cmds="add rename rm"
|
2022-08-15 19:17:20 +00:00
|
|
|
fleet_cmds="create pin purge rename restart rm track-latest"
|
2021-02-28 20:40:25 +00:00
|
|
|
internal_cmds="osinit"
|
2018-03-02 19:50:14 +00:00
|
|
|
key_cmds="add rm"
|
2019-06-04 15:31:32 +00:00
|
|
|
local_cmds="configure flash"
|
2018-03-02 19:50:14 +00:00
|
|
|
os_cmds="build-config configure download initialize versions"
|
2022-08-15 19:44:54 +00:00
|
|
|
release_cmds="finalize invalidate validate"
|
2021-02-28 20:40:25 +00:00
|
|
|
tag_cmds="rm set"
|
|
|
|
|
2018-03-02 19:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
COMPREPLY=()
|
|
|
|
cur=${COMP_WORDS[COMP_CWORD]}
|
|
|
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
|
|
|
|
|
|
|
if [ $COMP_CWORD -eq 1 ]
|
|
|
|
then
|
2021-02-28 20:40:25 +00:00
|
|
|
COMPREPLY=( $(compgen -W "${main_commands}" -- $cur) )
|
2018-03-02 19:50:14 +00:00
|
|
|
elif [ $COMP_CWORD -eq 2 ]
|
|
|
|
then
|
|
|
|
case "$prev" in
|
2021-02-28 20:40:25 +00:00
|
|
|
api-key)
|
|
|
|
COMPREPLY=( $(compgen -W "$api_key_cmds" -- $cur) )
|
|
|
|
;;
|
2023-05-25 15:05:47 +00:00
|
|
|
app)
|
|
|
|
COMPREPLY=( $(compgen -W "$app_cmds" -- $cur) )
|
|
|
|
;;
|
2023-05-25 15:59:27 +00:00
|
|
|
block)
|
|
|
|
COMPREPLY=( $(compgen -W "$block_cmds" -- $cur) )
|
|
|
|
;;
|
2021-02-28 20:40:25 +00:00
|
|
|
config)
|
2018-03-02 19:50:14 +00:00
|
|
|
COMPREPLY=( $(compgen -W "$config_cmds" -- $cur) )
|
|
|
|
;;
|
2021-02-28 20:40:25 +00:00
|
|
|
device)
|
2018-03-02 19:50:14 +00:00
|
|
|
COMPREPLY=( $(compgen -W "$device_cmds" -- $cur) )
|
|
|
|
;;
|
2021-02-28 20:40:25 +00:00
|
|
|
devices)
|
|
|
|
COMPREPLY=( $(compgen -W "$devices_cmds" -- $cur) )
|
|
|
|
;;
|
|
|
|
env)
|
2018-03-02 19:50:14 +00:00
|
|
|
COMPREPLY=( $(compgen -W "$env_cmds" -- $cur) )
|
|
|
|
;;
|
2021-07-15 13:41:38 +00:00
|
|
|
fleet)
|
|
|
|
COMPREPLY=( $(compgen -W "$fleet_cmds" -- $cur) )
|
|
|
|
;;
|
2021-02-28 20:40:25 +00:00
|
|
|
internal)
|
|
|
|
COMPREPLY=( $(compgen -W "$internal_cmds" -- $cur) )
|
|
|
|
;;
|
|
|
|
key)
|
2018-03-02 19:50:14 +00:00
|
|
|
COMPREPLY=( $(compgen -W "$key_cmds" -- $cur) )
|
|
|
|
;;
|
2021-02-28 20:40:25 +00:00
|
|
|
local)
|
2018-03-02 19:50:14 +00:00
|
|
|
COMPREPLY=( $(compgen -W "$local_cmds" -- $cur) )
|
|
|
|
;;
|
2021-02-28 20:40:25 +00:00
|
|
|
os)
|
2018-03-02 19:50:14 +00:00
|
|
|
COMPREPLY=( $(compgen -W "$os_cmds" -- $cur) )
|
|
|
|
;;
|
2021-09-18 23:07:58 +00:00
|
|
|
release)
|
|
|
|
COMPREPLY=( $(compgen -W "$release_cmds" -- $cur) )
|
|
|
|
;;
|
2021-02-28 20:40:25 +00:00
|
|
|
tag)
|
|
|
|
COMPREPLY=( $(compgen -W "$tag_cmds" -- $cur) )
|
2018-03-02 19:50:14 +00:00
|
|
|
;;
|
2021-02-28 20:40:25 +00:00
|
|
|
|
2018-03-02 19:50:14 +00:00
|
|
|
"*")
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
2018-10-19 14:38:50 +00:00
|
|
|
complete -F _balena_complete balena
|