mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-29 10:08:51 +00:00
33 lines
495 B
Plaintext
33 lines
495 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
#TEMPLATE FILE FOR BASH COMPLETION#
|
||
|
|
||
|
_balena_complete()
|
||
|
{
|
||
|
local cur prev
|
||
|
|
||
|
# Valid top-level completions
|
||
|
$main_commands$
|
||
|
# Sub-completions
|
||
|
$sub_cmds$
|
||
|
|
||
|
|
||
|
COMPREPLY=()
|
||
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||
|
|
||
|
if [ $COMP_CWORD -eq 1 ]
|
||
|
then
|
||
|
COMPREPLY=( $(compgen -W "${main_commands}" -- $cur) )
|
||
|
elif [ $COMP_CWORD -eq 2 ]
|
||
|
then
|
||
|
case "$prev" in
|
||
|
$sub_cmds_prev$
|
||
|
"*")
|
||
|
;;
|
||
|
esac
|
||
|
fi
|
||
|
|
||
|
}
|
||
|
complete -F _balena_complete balena
|