forked from shadowsocks/shadowsocks-libev
-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathss-manager
40 lines (39 loc) · 1.26 KB
/
ss-manager
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
_ss_manager()
{
local cur prev opts
opts='-s -b -p -k -f -t -m -c -a -n -u -U -v -h -A --mtu --help --mptcp -i -l --manager-address --executable'
cur=${COMP_WORDS[COMP_CWORD]}
prev="${COMP_WORDS[COMP_CWORD-1]}"
case "$prev" in
-c|-f|--executable)
_filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) )
;;
-s|-b|-l)
_known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) )
;;
-L)
compopt -o nospace
_known_hosts_real -c -- "${cur}" || OMPREPLY=( $(compgen -A hostname -S : -- ${cur}) )
;;
-m)
COMPREPLY=( $(compgen -W "$ciphers" -- ${cur}) )
;;
-a)
_allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) )
;;
-p|-k|-t|-n|--mtu)
;;
-i)
_available_interfaces -a || true
;;
--manager-address)
_known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) )
_filedir || COMPREPLY+=( $(compgen -o plusdirs -f ${cur}) )
;;
*)
COMPREPLY+=( $(compgen -W "${opts}" -- ${cur}) )
;;
esac
return 0
}
complete -F _ss_manager ss-manager