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
|
2024-07-10 22:02:22 +00:00
|
|
|
main_commands="api-key api-keys app block build config deploy device devices env envs fleet fleets internal join key keys leave local login logout logs notes orgs os preload push release releases scan settings ssh support tag tags tunnel util version whoami"
|
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"
|
2024-09-24 16:26:16 +00:00
|
|
|
device_cmds="deactivate identify init list local-mode move os-update pin public-url purge reboot register rename restart rm shutdown start-service stop-service 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
|