diff --git a/completions/ipsec b/completions/ipsec index dd757963..677e1e0e 100644 --- a/completions/ipsec +++ b/completions/ipsec @@ -7,11 +7,10 @@ have ipsec || return # Reads a file from stdin in the ipsec.conf(5) format. _ipsec_connections() { - COMPREPLY=() local keyword name while read -r keyword name; do if [[ $keyword = [#]* ]]; then continue; fi - [[ $keyword = 'conn' && $name != '%default' ]] && COMPREPLY+=("$name") + [[ $keyword == conn && $name != '%default' ]] && COMPREPLY+=( "$name" ) done COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) }