-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbash_completion
More file actions
52 lines (45 loc) · 1.3 KB
/
bash_completion
File metadata and controls
52 lines (45 loc) · 1.3 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# citus_dev completion
_citus_dev()
{
local cmd cur prev cmds opts clusters
COMPREPLY=()
_get_comp_words_by_ref cur prev
cmd="${COMP_WORDS[1]}"
cmds="make start stop restart"
case $prev in
make)
return 0
;;
start|stop|restart)
clusters=$(for x in `find . -type d -name 'coordinator' | awk -F '/' '{print $2}'`; do echo ${x} ; done );
COMPREPLY=($( compgen -W "${clusters}" -- "${cur}" ));
return 0
;;
esac
case $cmd in
make)
opts="--size --port --use-ssl --no-extension --mx --destroy --with-pgbouncer"
if [[ ${cur} == -* ]] ; then
COMPREPLY=($( compgen -W "${opts}" -- "${cur}"))
fi
return 0
;;
start|stop)
opts="--port --force"
if [[ ${cur} == -* ]] ; then
COMPREPLY=($( compgen -W "${opts}" -- "${cur}"))
fi
return 0
;;
restart)
opts="--port --watch"
if [[ ${cur} == -* ]] ; then
COMPREPLY=($( compgen -W "${opts}" -- "${cur}"))
fi
return 0
;;
esac
COMPREPLY=($( compgen -W "${cmds}" -- "${cur}"))
return 0
}
complete -F _citus_dev citus_dev