X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=shell-completion%2Fbash%2Flocalectl;h=84e2a6b09e83174e151d1fa7b2349baad327db24;hb=3ce09b7da2eb8b888066468663b2b5c81a05a03c;hp=ef19f01461ced6321fc0aa558cf9c9ca13624060;hpb=d611dadcc74db10ba533ee6859308f5fc505aee1;p=elogind.git diff --git a/shell-completion/bash/localectl b/shell-completion/bash/localectl index ef19f0146..84e2a6b09 100644 --- a/shell-completion/bash/localectl +++ b/shell-completion/bash/localectl @@ -18,9 +18,10 @@ # along with systemd; If not, see . __contains_word () { - local word=$1; shift - for w in $*; do [[ $w = $word ]] && return 0; done - return 1 + local w word=$1; shift + for w in "$@"; do + [[ $w = "$word" ]] && return + done } _localectl() { @@ -51,7 +52,7 @@ _localectl() { [X11]='set-x11-keymap' ) - for ((i=0; i <= COMP_CWORD; i++)); do + for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then verb=${COMP_WORDS[i]} break