From: Jason A. Donenfeld Date: Sun, 13 Dec 2020 21:29:09 +0000 (+0100) Subject: completion: add help and syncconf completions X-Git-Tag: v1.0.20210223~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e506135f7da13cc13b51f2d0db47da364b2de7b;p=thirdparty%2Fwireguard-tools.git completion: add help and syncconf completions Signed-off-by: Jason A. Donenfeld --- diff --git a/src/completion/wg.bash-completion b/src/completion/wg.bash-completion index 445f0e8..3c062b4 100644 --- a/src/completion/wg.bash-completion +++ b/src/completion/wg.bash-completion @@ -5,12 +5,12 @@ _wg_completion() { local a if [[ $COMP_CWORD -eq 1 ]]; then - COMPREPLY+=( $(compgen -W "show showconf set setconf addconf genkey genpsk pubkey" -- "${COMP_WORDS[1]}") ) + COMPREPLY+=( $(compgen -W "help show showconf set setconf addconf syncconf genkey genpsk pubkey" -- "${COMP_WORDS[1]}") ) return fi case "${COMP_WORDS[1]}" in genkey|genpsk|pubkey|help) return; ;; - show|showconf|set|setconf|addconf) ;; + show|showconf|set|setconf|addconf|syncconf) ;; *) return; esac @@ -26,7 +26,7 @@ _wg_completion() { return fi - if [[ $COMP_CWORD -eq 3 && ( ${COMP_WORDS[1]} == setconf || ${COMP_WORDS[1]} == addconf ) ]]; then + if [[ $COMP_CWORD -eq 3 && ( ${COMP_WORDS[1]} == setconf || ${COMP_WORDS[1]} == addconf || ${COMP_WORDS[1]} == syncconf) ]]; then compopt -o filenames mapfile -t a < <(compgen -f -- "${COMP_WORDS[3]}") COMPREPLY+=( "${a[@]}" )