mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-30 10:38:50 +00:00
a3e90182bc
Change-type: patch
33 lines
495 B
Bash
33 lines
495 B
Bash
#!/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
|