bash-completion: use a better definition of __contains_word

- scope the iterator var
- use the correct, quoted, non-expansion prone positional parameter
  notation
- prevent expansion on RHS of comparison
- remove unneeded explicit returns.

This really should be defined only once...
This commit is contained in:
Dave Reisner
2013-07-30 13:04:46 -04:00
parent 751e75769a
commit a72d698d0d
9 changed files with 36 additions and 27 deletions
+4 -3
View File
@@ -32,9 +32,10 @@ __systemd_properties() {
}
__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
}
__filter_units_by_property () {