-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathv2sub-completion.bash
More file actions
37 lines (35 loc) · 1.01 KB
/
Copy pathv2sub-completion.bash
File metadata and controls
37 lines (35 loc) · 1.01 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
#!/bin/bash
_v2sub_completion() {
local cur prev opts sub_opts ser_opts conf_opts conn_opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-sub -ser -conf -conn -v -h"
sub_opts="add update customer remove list"
ser_opts="list set setx setflush speedtest"
conf_opts="sport hport lconn list"
conn_opts="start start-pac kill"
case "${prev}" in
-sub)
COMPREPLY=( $(compgen -W "${sub_opts}" -- ${cur}) )
return 0
;;
-ser)
COMPREPLY=( $(compgen -W "${ser_opts}" -- ${cur}) )
return 0
;;
-conf)
COMPREPLY=( $(compgen -W "${conf_opts}" -- ${cur}) )
return 0
;;
-conn)
COMPREPLY=( $(compgen -W "${conn_opts}" -- ${cur}) )
return 0
;;
*)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
esac
}
complete -F _v2sub_completion v2sub