mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +00:00
Docs: Generate balena auto-completion
Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipulgupta2048@gmail.com>
This commit is contained in:
parent
2de9d526e5
commit
4cd8f4c16e
@ -65,6 +65,12 @@ const commandHeadings: { [key: string]: string } = {
|
|||||||
orgs: 'Organizations',
|
orgs: 'Organizations',
|
||||||
os: 'OS',
|
os: 'OS',
|
||||||
util: 'Utilities',
|
util: 'Utilities',
|
||||||
|
ssh: 'Network',
|
||||||
|
scan: 'Network',
|
||||||
|
tunnel: 'Network',
|
||||||
|
build: 'Deploy',
|
||||||
|
join: 'Platform',
|
||||||
|
leave: 'Platform',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fetch all available commands
|
// Fetch all available commands
|
||||||
|
@ -8,14 +8,13 @@ _balena() {
|
|||||||
local context state line curcontext="$curcontext"
|
local context state line curcontext="$curcontext"
|
||||||
|
|
||||||
# Valid top-level completions
|
# Valid top-level completions
|
||||||
main_commands=( api-key api-keys app auth block config deploy deploy device device devices env envs fleet fleet fleets internal key key keys local logs network notes orgs os platform preload push release release releases settings support tag tags util version )
|
main_commands=( api-key api-keys app auth block build config deploy device device devices env envs fleet fleet fleets internal join key key keys leave local logs notes orgs os preload push release release releases scan settings ssh support tag tags tunnel util version )
|
||||||
# Sub-completions
|
# Sub-completions
|
||||||
api_key_cmds=( generate revoke )
|
api_key_cmds=( generate revoke )
|
||||||
app_cmds=( create )
|
app_cmds=( create )
|
||||||
auth_cmds=( login logout whoami )
|
auth_cmds=( login logout whoami )
|
||||||
block_cmds=( create )
|
block_cmds=( create )
|
||||||
config_cmds=( generate inject read reconfigure write )
|
config_cmds=( generate inject read reconfigure write )
|
||||||
deploy_cmds=( build )
|
|
||||||
device_cmds=( deactivate identify init local-mode move os-update pin public-url purge reboot register rename restart rm shutdown start-service stop-service track-fleet )
|
device_cmds=( deactivate identify init local-mode move os-update pin public-url purge reboot register rename restart rm shutdown start-service stop-service track-fleet )
|
||||||
devices_cmds=( supported )
|
devices_cmds=( supported )
|
||||||
env_cmds=( add rename rm )
|
env_cmds=( add rename rm )
|
||||||
@ -23,9 +22,7 @@ _balena() {
|
|||||||
internal_cmds=( osinit )
|
internal_cmds=( osinit )
|
||||||
key_cmds=( add rm )
|
key_cmds=( add rm )
|
||||||
local_cmds=( configure flash )
|
local_cmds=( configure flash )
|
||||||
network_cmds=( scan ssh tunnel )
|
|
||||||
os_cmds=( build-config configure download initialize versions )
|
os_cmds=( build-config configure download initialize versions )
|
||||||
platform_cmds=( join leave )
|
|
||||||
release_cmds=( finalize invalidate validate )
|
release_cmds=( finalize invalidate validate )
|
||||||
tag_cmds=( rm set )
|
tag_cmds=( rm set )
|
||||||
|
|
||||||
@ -61,9 +58,6 @@ _balena_sec_cmds() {
|
|||||||
"config")
|
"config")
|
||||||
_describe -t config_cmds 'config_cmd' config_cmds "$@" && ret=0
|
_describe -t config_cmds 'config_cmd' config_cmds "$@" && ret=0
|
||||||
;;
|
;;
|
||||||
"deploy")
|
|
||||||
_describe -t deploy_cmds 'deploy_cmd' deploy_cmds "$@" && ret=0
|
|
||||||
;;
|
|
||||||
"device")
|
"device")
|
||||||
_describe -t device_cmds 'device_cmd' device_cmds "$@" && ret=0
|
_describe -t device_cmds 'device_cmd' device_cmds "$@" && ret=0
|
||||||
;;
|
;;
|
||||||
@ -85,15 +79,9 @@ _balena_sec_cmds() {
|
|||||||
"local")
|
"local")
|
||||||
_describe -t local_cmds 'local_cmd' local_cmds "$@" && ret=0
|
_describe -t local_cmds 'local_cmd' local_cmds "$@" && ret=0
|
||||||
;;
|
;;
|
||||||
"network")
|
|
||||||
_describe -t network_cmds 'network_cmd' network_cmds "$@" && ret=0
|
|
||||||
;;
|
|
||||||
"os")
|
"os")
|
||||||
_describe -t os_cmds 'os_cmd' os_cmds "$@" && ret=0
|
_describe -t os_cmds 'os_cmd' os_cmds "$@" && ret=0
|
||||||
;;
|
;;
|
||||||
"platform")
|
|
||||||
_describe -t platform_cmds 'platform_cmd' platform_cmds "$@" && ret=0
|
|
||||||
;;
|
|
||||||
"release")
|
"release")
|
||||||
_describe -t release_cmds 'release_cmd' release_cmds "$@" && ret=0
|
_describe -t release_cmds 'release_cmd' release_cmds "$@" && ret=0
|
||||||
;;
|
;;
|
||||||
|
@ -7,14 +7,13 @@ _balena_complete()
|
|||||||
local cur prev
|
local cur prev
|
||||||
|
|
||||||
# Valid top-level completions
|
# Valid top-level completions
|
||||||
main_commands="api-key api-keys app auth block config deploy deploy device device devices env envs fleet fleet fleets internal key key keys local logs network notes orgs os platform preload push release release releases settings support tag tags util version"
|
main_commands="api-key api-keys app auth block build config deploy device device devices env envs fleet fleet fleets internal join key key keys leave local logs notes orgs os preload push release release releases scan settings ssh support tag tags tunnel util version"
|
||||||
# Sub-completions
|
# Sub-completions
|
||||||
api_key_cmds="generate revoke"
|
api_key_cmds="generate revoke"
|
||||||
app_cmds="create"
|
app_cmds="create"
|
||||||
auth_cmds="login logout whoami"
|
auth_cmds="login logout whoami"
|
||||||
block_cmds="create"
|
block_cmds="create"
|
||||||
config_cmds="generate inject read reconfigure write"
|
config_cmds="generate inject read reconfigure write"
|
||||||
deploy_cmds="build"
|
|
||||||
device_cmds="deactivate identify init local-mode move os-update pin public-url purge reboot register rename restart rm shutdown start-service stop-service track-fleet"
|
device_cmds="deactivate identify init local-mode move os-update pin public-url purge reboot register rename restart rm shutdown start-service stop-service track-fleet"
|
||||||
devices_cmds="supported"
|
devices_cmds="supported"
|
||||||
env_cmds="add rename rm"
|
env_cmds="add rename rm"
|
||||||
@ -22,9 +21,7 @@ _balena_complete()
|
|||||||
internal_cmds="osinit"
|
internal_cmds="osinit"
|
||||||
key_cmds="add rm"
|
key_cmds="add rm"
|
||||||
local_cmds="configure flash"
|
local_cmds="configure flash"
|
||||||
network_cmds="scan ssh tunnel"
|
|
||||||
os_cmds="build-config configure download initialize versions"
|
os_cmds="build-config configure download initialize versions"
|
||||||
platform_cmds="join leave"
|
|
||||||
release_cmds="finalize invalidate validate"
|
release_cmds="finalize invalidate validate"
|
||||||
tag_cmds="rm set"
|
tag_cmds="rm set"
|
||||||
|
|
||||||
@ -55,9 +52,6 @@ _balena_complete()
|
|||||||
config)
|
config)
|
||||||
COMPREPLY=( $(compgen -W "$config_cmds" -- $cur) )
|
COMPREPLY=( $(compgen -W "$config_cmds" -- $cur) )
|
||||||
;;
|
;;
|
||||||
deploy)
|
|
||||||
COMPREPLY=( $(compgen -W "$deploy_cmds" -- $cur) )
|
|
||||||
;;
|
|
||||||
device)
|
device)
|
||||||
COMPREPLY=( $(compgen -W "$device_cmds" -- $cur) )
|
COMPREPLY=( $(compgen -W "$device_cmds" -- $cur) )
|
||||||
;;
|
;;
|
||||||
@ -79,15 +73,9 @@ _balena_complete()
|
|||||||
local)
|
local)
|
||||||
COMPREPLY=( $(compgen -W "$local_cmds" -- $cur) )
|
COMPREPLY=( $(compgen -W "$local_cmds" -- $cur) )
|
||||||
;;
|
;;
|
||||||
network)
|
|
||||||
COMPREPLY=( $(compgen -W "$network_cmds" -- $cur) )
|
|
||||||
;;
|
|
||||||
os)
|
os)
|
||||||
COMPREPLY=( $(compgen -W "$os_cmds" -- $cur) )
|
COMPREPLY=( $(compgen -W "$os_cmds" -- $cur) )
|
||||||
;;
|
;;
|
||||||
platform)
|
|
||||||
COMPREPLY=( $(compgen -W "$platform_cmds" -- $cur) )
|
|
||||||
;;
|
|
||||||
release)
|
release)
|
||||||
COMPREPLY=( $(compgen -W "$release_cmds" -- $cur) )
|
COMPREPLY=( $(compgen -W "$release_cmds" -- $cur) )
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user