2021-05-25 07:10:16 +00:00
|
|
|
_innernet() {
|
2023-06-14 08:49:16 +00:00
|
|
|
local i cur prev opts cmd
|
2021-05-25 07:10:16 +00:00
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
cmd=""
|
|
|
|
opts=""
|
|
|
|
|
|
|
|
for i in ${COMP_WORDS[@]}
|
|
|
|
do
|
2023-06-14 08:49:16 +00:00
|
|
|
case "${cmd},${i}" in
|
|
|
|
",$1")
|
2021-05-25 07:10:16 +00:00
|
|
|
cmd="innernet"
|
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,add-association)
|
|
|
|
cmd="innernet__add__association"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,add-cidr)
|
|
|
|
cmd="innernet__add__cidr"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,add-peer)
|
|
|
|
cmd="innernet__add__peer"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,completions)
|
|
|
|
cmd="innernet__completions"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,delete-association)
|
|
|
|
cmd="innernet__delete__association"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,delete-cidr)
|
|
|
|
cmd="innernet__delete__cidr"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,disable-peer)
|
|
|
|
cmd="innernet__disable__peer"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,down)
|
|
|
|
cmd="innernet__down"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,enable-peer)
|
|
|
|
cmd="innernet__enable__peer"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,fetch)
|
|
|
|
cmd="innernet__fetch"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,help)
|
|
|
|
cmd="innernet__help"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,install)
|
|
|
|
cmd="innernet__install"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,list-associations)
|
|
|
|
cmd="innernet__list__associations"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,list-cidrs)
|
|
|
|
cmd="innernet__list__cidrs"
|
2021-06-14 14:53:02 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,override-endpoint)
|
|
|
|
cmd="innernet__override__endpoint"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,rename-peer)
|
|
|
|
cmd="innernet__rename__peer"
|
2021-05-31 15:23:14 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,set-listen-port)
|
|
|
|
cmd="innernet__set__listen__port"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,show)
|
|
|
|
cmd="innernet__show"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,uninstall)
|
|
|
|
cmd="innernet__uninstall"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet,up)
|
|
|
|
cmd="innernet__up"
|
|
|
|
;;
|
|
|
|
innernet__help,add-association)
|
|
|
|
cmd="innernet__help__add__association"
|
|
|
|
;;
|
|
|
|
innernet__help,add-cidr)
|
|
|
|
cmd="innernet__help__add__cidr"
|
|
|
|
;;
|
|
|
|
innernet__help,add-peer)
|
|
|
|
cmd="innernet__help__add__peer"
|
|
|
|
;;
|
|
|
|
innernet__help,completions)
|
|
|
|
cmd="innernet__help__completions"
|
|
|
|
;;
|
|
|
|
innernet__help,delete-association)
|
|
|
|
cmd="innernet__help__delete__association"
|
|
|
|
;;
|
|
|
|
innernet__help,delete-cidr)
|
|
|
|
cmd="innernet__help__delete__cidr"
|
|
|
|
;;
|
|
|
|
innernet__help,disable-peer)
|
|
|
|
cmd="innernet__help__disable__peer"
|
|
|
|
;;
|
|
|
|
innernet__help,down)
|
|
|
|
cmd="innernet__help__down"
|
|
|
|
;;
|
|
|
|
innernet__help,enable-peer)
|
|
|
|
cmd="innernet__help__enable__peer"
|
|
|
|
;;
|
|
|
|
innernet__help,fetch)
|
|
|
|
cmd="innernet__help__fetch"
|
|
|
|
;;
|
|
|
|
innernet__help,help)
|
|
|
|
cmd="innernet__help__help"
|
|
|
|
;;
|
|
|
|
innernet__help,install)
|
|
|
|
cmd="innernet__help__install"
|
|
|
|
;;
|
|
|
|
innernet__help,list-associations)
|
|
|
|
cmd="innernet__help__list__associations"
|
|
|
|
;;
|
|
|
|
innernet__help,list-cidrs)
|
|
|
|
cmd="innernet__help__list__cidrs"
|
|
|
|
;;
|
|
|
|
innernet__help,override-endpoint)
|
|
|
|
cmd="innernet__help__override__endpoint"
|
|
|
|
;;
|
|
|
|
innernet__help,rename-peer)
|
|
|
|
cmd="innernet__help__rename__peer"
|
|
|
|
;;
|
|
|
|
innernet__help,set-listen-port)
|
|
|
|
cmd="innernet__help__set__listen__port"
|
|
|
|
;;
|
|
|
|
innernet__help,show)
|
|
|
|
cmd="innernet__help__show"
|
|
|
|
;;
|
|
|
|
innernet__help,uninstall)
|
|
|
|
cmd="innernet__help__uninstall"
|
|
|
|
;;
|
|
|
|
innernet__help,up)
|
|
|
|
cmd="innernet__help__up"
|
2021-05-25 07:10:16 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
case "${cmd}" in
|
|
|
|
innernet)
|
2023-06-14 08:49:16 +00:00
|
|
|
opts="-v -c -d -h -V --verbose --config-dir --data-dir --no-routing --backend --mtu --help --version install show up fetch uninstall down add-peer rename-peer add-cidr delete-cidr list-cidrs disable-peer enable-peer add-association delete-association list-associations set-listen-port override-endpoint completions help"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
2021-12-05 17:35:18 +00:00
|
|
|
--config-dir)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2022-01-11 20:18:19 +00:00
|
|
|
-c)
|
2021-12-05 17:35:18 +00:00
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--data-dir)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2022-01-11 20:18:19 +00:00
|
|
|
-d)
|
2021-12-05 17:35:18 +00:00
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
--backend)
|
2022-09-24 04:16:35 +00:00
|
|
|
COMPREPLY=($(compgen -W "kernel userspace" -- "${cur}"))
|
2021-05-25 07:10:16 +00:00
|
|
|
return 0
|
|
|
|
;;
|
2021-06-14 14:53:02 +00:00
|
|
|
--mtu)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__add__association)
|
2023-06-14 08:49:16 +00:00
|
|
|
opts="-h --yes --help <INTERFACE> [CIDR1] [CIDR2]"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__add__cidr)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --name --cidr --parent --yes --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
--name)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--cidr)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--parent)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__add__peer)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --name --ip --auto-ip --cidr --admin --yes --save-config --invite-expires --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
--name)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--ip)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--cidr)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--admin)
|
2023-06-14 08:49:16 +00:00
|
|
|
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
|
2021-05-25 07:10:16 +00:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--save-config)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--invite-expires)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__completions)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --help bash elvish fish powershell zsh"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__delete__association)
|
2023-06-14 08:49:16 +00:00
|
|
|
opts="-h --yes --help <INTERFACE> [CIDR1] [CIDR2]"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__delete__cidr)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --name --yes --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
--name)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__disable__peer)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__down)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__enable__peer)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__fetch)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --hosts-path --no-write-hosts --no-nat-traversal --exclude-nat-candidates --no-nat-candidates --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
--hosts-path)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-12-05 17:35:18 +00:00
|
|
|
--exclude-nat-candidates)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help)
|
2023-06-14 08:49:16 +00:00
|
|
|
opts="install show up fetch uninstall down add-peer rename-peer add-cidr delete-cidr list-cidrs disable-peer enable-peer add-association delete-association list-associations set-listen-port override-endpoint completions help"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
2023-06-14 08:49:16 +00:00
|
|
|
innernet__help__add__association)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__add__cidr)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__add__peer)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__completions)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__delete__association)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__delete__cidr)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__disable__peer)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__down)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__enable__peer)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__fetch)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__help)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__install)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__list__associations)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__list__cidrs)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__override__endpoint)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__rename__peer)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__set__listen__port)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__show)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__uninstall)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__help__up)
|
|
|
|
opts=""
|
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
innernet__install)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-d -h --hosts-path --no-write-hosts --name --default-name --delete-invite --no-nat-traversal --exclude-nat-candidates --no-nat-candidates --help <INVITE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
--hosts-path)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--name)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-12-05 17:35:18 +00:00
|
|
|
--exclude-nat-candidates)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__list__associations)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
2021-06-14 14:53:02 +00:00
|
|
|
innernet__list__cidrs)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-t -h --tree --help <INTERFACE>"
|
2021-06-14 14:53:02 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
innernet__override__endpoint)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-e -u -h --endpoint --unset --yes --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
2021-12-05 17:35:18 +00:00
|
|
|
--endpoint)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2022-01-11 20:18:19 +00:00
|
|
|
-e)
|
2021-12-05 17:35:18 +00:00
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-31 15:23:14 +00:00
|
|
|
innernet__rename__peer)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-h --name --new-name --yes --help <INTERFACE>"
|
2021-05-31 15:23:14 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
--name)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--new-name)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
innernet__set__listen__port)
|
2022-01-11 20:18:19 +00:00
|
|
|
opts="-l -u -h --listen-port --unset --yes --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
2021-12-05 17:35:18 +00:00
|
|
|
--listen-port)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2022-01-11 20:18:19 +00:00
|
|
|
-l)
|
2021-12-05 17:35:18 +00:00
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__show)
|
2023-06-14 08:49:16 +00:00
|
|
|
opts="-s -t -h --short --tree --help [INTERFACE]"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__uninstall)
|
2022-01-31 19:56:11 +00:00
|
|
|
opts="-h --yes --help <INTERFACE>"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
innernet__up)
|
2023-06-14 08:49:16 +00:00
|
|
|
opts="-d -h --daemon --interval --hosts-path --no-write-hosts --no-nat-traversal --exclude-nat-candidates --no-nat-candidates --help [INTERFACE]"
|
2021-05-25 07:10:16 +00:00
|
|
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case "${prev}" in
|
|
|
|
--interval)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--hosts-path)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-12-05 17:35:18 +00:00
|
|
|
--exclude-nat-candidates)
|
|
|
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2021-05-25 07:10:16 +00:00
|
|
|
*)
|
|
|
|
COMPREPLY=()
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
complete -F _innernet -o bashdefault -o default innernet
|