Shellcheck compliance

scripts/openvpn/bash-completion
 * fix SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
 * Added double quotes
This commit is contained in:
4s3ti 2021-11-02 18:30:12 +01:00
parent 685133bc00
commit 4d2e3ed3f8

View file

@ -10,13 +10,13 @@ _pivpn()
if [ "${#COMP_WORDS[@]}" -eq 2 ] if [ "${#COMP_WORDS[@]}" -eq 2 ]
then then
if [[ ${cur} == -* ]] ; then if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${dashopts}" -- "${cur}") ) COMPREPLY=( "$(compgen -W "${dashopts}" -- "${cur}")" )
else else
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( "$(compgen -W "${opts}" -- "${cur}")" )
fi fi
elif [[ ( "$prev" == "add" || "$prev" == "-a" ) && "${#COMP_WORDS[@]}" -eq 3 ]] elif [[ ( "$prev" == "add" || "$prev" == "-a" ) && "${#COMP_WORDS[@]}" -eq 3 ]]
then then
COMPREPLY=( $(compgen -W "nopass" -- "${cur}") ) COMPREPLY=( "$(compgen -W "nopass" -- "${cur}")" )
fi fi
return 0 return 0
} }