2021-02-14 12:42:34 +00:00
|
|
|
#!/bin/bash
|
2019-12-02 16:00:39 +00:00
|
|
|
_pivpn()
|
|
|
|
{
|
2021-02-14 13:05:30 +00:00
|
|
|
local cur opts
|
2019-12-02 16:00:39 +00:00
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
2020-12-08 23:44:51 +00:00
|
|
|
dashopts="-a -c -d -l -qr -r -h -u -up -bk -off -on"
|
|
|
|
opts="add clients debug list qrcode remove help uninstall update backup (temp) off (temp) on"
|
2022-07-26 13:20:35 +00:00
|
|
|
if [ "${#COMP_WORDS[@]}" -eq 2 ]; then
|
2019-12-02 16:00:39 +00:00
|
|
|
if [[ ${cur} == -* ]] ; then
|
2021-11-03 13:59:06 +00:00
|
|
|
COMPREPLY=( "$(compgen -W "${dashopts}" -- "${cur}")" )
|
2019-12-02 16:00:39 +00:00
|
|
|
else
|
2021-11-03 13:59:06 +00:00
|
|
|
COMPREPLY=( "$(compgen -W "${opts}" -- "${cur}")" )
|
2019-12-02 16:00:39 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
complete -F _pivpn pivpn
|