innernet/doc/innernet.completions.bash

499 lines
16 KiB
Bash
Raw Normal View History

_innernet() {
local i cur prev opts cmds
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
cmd=""
opts=""
for i in ${COMP_WORDS[@]}
do
case "${i}" in
2022-01-11 20:18:19 +00:00
"$1")
cmd="innernet"
;;
add-association)
cmd+="__add__association"
;;
add-cidr)
cmd+="__add__cidr"
;;
add-peer)
cmd+="__add__peer"
;;
completions)
cmd+="__completions"
;;
delete-association)
cmd+="__delete__association"
;;
delete-cidr)
cmd+="__delete__cidr"
;;
disable-peer)
cmd+="__disable__peer"
;;
down)
cmd+="__down"
;;
enable-peer)
cmd+="__enable__peer"
;;
fetch)
cmd+="__fetch"
;;
help)
cmd+="__help"
;;
install)
cmd+="__install"
;;
list-associations)
cmd+="__list__associations"
;;
2021-06-14 14:53:02 +00:00
list-cidrs)
cmd+="__list__cidrs"
;;
override-endpoint)
cmd+="__override__endpoint"
;;
2021-05-31 15:23:14 +00:00
rename-peer)
cmd+="__rename__peer"
;;
set-listen-port)
cmd+="__set__listen__port"
;;
show)
cmd+="__show"
;;
uninstall)
cmd+="__uninstall"
;;
up)
cmd+="__up"
;;
*)
;;
esac
done
case "${cmd}" in
innernet)
2022-01-11 20:18:19 +00:00
opts="-h -V -v -c -d --help --version --verbose --config-dir --data-dir --no-routing --backend --mtu 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"
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
;;
--backend)
2022-03-15 02:15:56 +00:00
COMPREPLY=($(compgen -W "" -- "${cur}"))
return 0
;;
2021-06-14 14:53:02 +00:00
--mtu)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
innernet__add__association)
2022-01-31 19:56:11 +00:00
opts="-h --yes --help <INTERFACE> <CIDR1> <CIDR2>"
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>"
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>"
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)
COMPREPLY=($(compgen -f "${cur}"))
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"
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)
2022-01-31 19:56:11 +00:00
opts="-h --yes --help <INTERFACE> <CIDR1> <CIDR2>"
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>"
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>"
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>"
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>"
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>"
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
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
innernet__help)
2022-01-18 06:19:53 +00:00
opts="<SUBCOMMAND>..."
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__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>"
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
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
innernet__list__associations)
2022-01-11 20:18:19 +00:00
opts="-h --help <INTERFACE>"
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
;;
innernet__override__endpoint)
2022-01-11 20:18:19 +00:00
opts="-e -u -h --endpoint --unset --yes --help <INTERFACE>"
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
;;
*)
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
;;
innernet__set__listen__port)
2022-01-11 20:18:19 +00:00
opts="-l -u -h --listen-port --unset --yes --help <INTERFACE>"
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
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
innernet__show)
2022-01-11 20:18:19 +00:00
opts="-s -t -h --short --tree --help <INTERFACE>"
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>"
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)
2022-01-11 20:18:19 +00:00
opts="-d -h --daemon --interval --hosts-path --no-write-hosts --no-nat-traversal --exclude-nat-candidates --no-nat-candidates --help <INTERFACE>"
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
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
esac
}
complete -F _innernet -o bashdefault -o default innernet