-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrcdk
53 lines (51 loc) · 1.27 KB
/
rcdk
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
53
_rcdk()
{
local cur prev opts
# Current argument
cur=${COMP_WORDS[COMP_CWORD]}
# Previous argument
prev=${COMP_WORDS[COMP_CWORD-1]}
# Options
opts="help config ping init update bundle sysusers apps ssl dns servers services dbs dbusers ssh"
case "$prev" in
sysusers)
COMPREPLY=( $(compgen -W "create delete list passwd" -- $cur) )
return 0
;;
apps)
COMPREPLY=( $(compgen -W "create delete list" -- $cur) )
return 0
;;
ssl)
COMPREPLY=( $(compgen -W "info on update off" -- $cur) )
return 0
;;
dns)
COMPREPLY=( $(compgen -W " list add delete" -- $cur) )
return 0
;;
servers)
COMPREPLY=( $(compgen -W "add delete info check list" -- $cur) )
return 0
;;
services)
COMPREPLY=( $(compgen -W "list start stop restart reload" -- $cur) )
return 0
;;
dbs)
COMPREPLY=( $(compgen -W "create delete list" -- $cur) )
return 0
;;
dbusers)
COMPREPLY=( $(compgen -W "create delete list attach revoke passwd" -- $cur) )
return 0
;;
ssh)
COMPREPLY=( $(compgen -W "add delete list store" -- $cur) )
return 0
;;
esac
COMPREPLY=( $(compgen -W "$opts" -- $cur) )
return 0
}
complete -F _rcdk rcdk