-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbash-completion
34 lines (30 loc) · 918 Bytes
/
bash-completion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#@IgnoreInspection BashAddShebang
# bash completion for depy
have depy &&
_depy()
{
COMPREPLY=()
local cur prev servers
local cmd="${1##*/}"
local line=$COMP_LINE
_get_comp_words_by_ref -n : cur prev
_expand || return 0
if [[ $line =~ ^depy\ deploy\ [a-z]+\ .*$ ]] ; then
COMPREPLY=( $(compgen -W "--verbose --incremental --skip-pre --skip-remote --skip-post" -- "$cur") )
return 0
fi
case $prev in
setup|deploy|releases|rollback)
if [ -f .depy ]; then
servers=$(grep '_host' .depy | sed -e 's/\(.*\)_host.*/\1/')
COMPREPLY=( $( compgen -W "$servers" -- "$cur" ) )
fi
return 0
;;
esac
if [ $prev = $cmd ]; then
COMPREPLY=( $( compgen -W 'init setup deploy releases rollback pack pack-list update' -- "$cur" ) )
fi
return 0
} &&
complete -F _depy depy