25 lines
686 B
Bash
25 lines
686 B
Bash
# bash completion for vpn-router-caddy -*- shell-script -*-
|
|
|
|
_vpn_router_caddy()
|
|
{
|
|
local cur prev words cword
|
|
_init_completion || return
|
|
|
|
# After the command only --help is left.
|
|
local word
|
|
for word in "${words[@]:1:cword-1}"; do
|
|
if [[ $word != -* ]]; then
|
|
[[ $cur == -* ]] && COMPREPLY=($(compgen -W '--help' -- "$cur"))
|
|
return
|
|
fi
|
|
done
|
|
if [[ $cur == -* ]]; then
|
|
COMPREPLY=($(compgen -W '--json --help' -- "$cur"))
|
|
else
|
|
COMPREPLY=($(compgen -W 'status apply use-upstream' -- "$cur"))
|
|
fi
|
|
} &&
|
|
complete -F _vpn_router_caddy vpn-router-caddy
|
|
|
|
# ex: filetype=sh
|