We are happy to answer your questions about the code or discuss technical ideas.
Please complete the following checklist (by adding [x]):
Would it be possible to add CLI shell completion scripts into installation package?
I guess there some Python modules exist to automate this, else here's the simple Bash completion script that I just created locally:
Expand for script code
_protonvpn() {
local cur prev
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD - 1]}
COMMANDS=($(compgen -W "$(protonvpn --help 2>&1 | sed -En '/^Commands:$/,/^$/{/^(Commands:)?$/!p}' | awk '{print $1}')" -- "$cur"))
# Global commands
if [[ $prev == protonvpn ]]; then
COMPREPLY+=($(compgen -W "${COMMANDS[*]}" -- "$cur"))
if [[ $cur == -* ]]; then
COMPREPLY+=($(compgen -W "$(protonvpn --help 2>&1 | grep -Eo '[[:space:]]+(-{1,2}[a-zA-Z0-9-]+)')" -- "$cur"))
fi
return 0
fi
if [[ " ${COMMANDS[*]} " == *" $prev "* || $cur == -* ]]; then
COMPREPLY+=($(compgen -W "$(protonvpn $prev --help 2>&1 | grep -Eo '[[:space:]]+(-{1,2}[a-zA-Z0-9-]+)')" -- "$cur"))
fi
}
complete -F _protonvpn protonvpn
# vim: set filetype=bash shiftwidth=4 tabstop=4 noexpandtab autoindent:
Thanks.
Please complete the following checklist (by adding [x]):
Would it be possible to add CLI shell completion scripts into installation package?
I guess there some Python modules exist to automate this, else here's the simple Bash completion script that I just created locally:
Expand for script code
Thanks.