Skip to content

Commit 13c28e9

Browse files
committed
refactor(completions/*): ensure quoting for compgen -W '${arr[@]}'
1 parent eedb716 commit 13c28e9

File tree

22 files changed

+34
-34
lines changed

22 files changed

+34
-34
lines changed

completions/ccze

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ _ccze()
2525
;;
2626
--option | -${noargopts}o)
2727
local -a opts=(scroll wordcolor lookups transparent cssfile)
28-
COMPREPLY=($(compgen -W '${opts[@]} ${opts[@]/#/no}' -- "$cur"))
28+
COMPREPLY=($(compgen -W '"${opts[@]}" "${opts[@]/#/no}"' -- "$cur"))
2929
return
3030
;;
3131
--plugin | -${noargopts}p)

completions/complete

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ _complete()
4040
local -a opts=($(compgen -W '$(_parse_usage help "-s $1")' -- "$cur"))
4141
# -F, -C do not work the expected way with compgen
4242
[[ $1 != *compgen ]] || opts=("${opts[@]//-[FC]/}")
43-
COMPREPLY=($(compgen -W '${opts[@]}' -- "$cur"))
43+
COMPREPLY=($(compgen -W '"${opts[@]}"' -- "$cur"))
4444
else
4545
COMPREPLY=($(compgen -A command -- "$cur"))
4646
fi

completions/crontab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ _crontab()
3636
done
3737

3838
if [[ $cur == -* ]]; then
39-
COMPREPLY=($(compgen -W '${!opts[@]}' -- "$cur"))
39+
COMPREPLY=($(compgen -W '"${!opts[@]}"' -- "$cur"))
4040
return
4141
fi
4242

completions/curl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ _curl()
113113
# Looks like an option? Likely no --help category support
114114
[[ $x != -* ]] || return
115115
done
116-
COMPREPLY=($(compgen -W '${categories[@]}' -- "$cur"))
116+
COMPREPLY=($(compgen -W '"${categories[@]}"' -- "$cur"))
117117
fi
118118
return
119119
;;

completions/cvs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ _comp_xfunc_cvs_roots()
4141
[[ -v CVSROOT ]] && cvsroots=("$CVSROOT")
4242
[[ -r ~/.cvspass ]] && cvsroots+=($(awk '{ print $2 }' ~/.cvspass))
4343
[[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots <CVS/Root
44-
COMPREPLY=($(compgen -W '${cvsroots[@]}' -- "$cur"))
44+
COMPREPLY=($(compgen -W '"${cvsroots[@]}"' -- "$cur"))
4545
__ltrim_colon_completions "$cur"
4646
}
4747

completions/dpkg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ _comp_cmd_dpkg_reconfigure()
139139
--frontend | -${noargopts}f)
140140
_comp_expand_glob opt '/usr/share/perl5/Debconf/FrontEnd/*'
141141
if ((${#opt[@]})); then
142-
opt=(${opt[@]##*/})
143-
opt=(${opt[@]%.pm})
144-
COMPREPLY=($(compgen -W '${opt[@]}' -- "$cur"))
142+
opt=("${opt[@]##*/}")
143+
opt=("${opt[@]%.pm}")
144+
COMPREPLY=($(compgen -W '"${opt[@]}"' -- "$cur"))
145145
fi
146146
return
147147
;;

completions/hunspell

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ _hunspell()
1616
dicts=("${dicts[@]##*/}")
1717
dicts=("${dicts[@]%.dic}")
1818
local IFS=$'\n'
19-
COMPREPLY=($(compgen -W '${dicts[@]}' -- "$cur"))
19+
COMPREPLY=($(compgen -W '"${dicts[@]}"' -- "$cur"))
2020
fi
2121
return
2222
;;

completions/ipmitool

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ _ipmitool()
7676
done
7777

7878
if ! "$has_cmd"; then
79-
COMPREPLY=($(compgen -W '${cmds[@]}' -- "$cur"))
79+
COMPREPLY=($(compgen -W '"${cmds[@]}"' -- "$cur"))
8080
return
8181
fi
8282

completions/mplayer

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ _mplayer()
6060
cp=($(iconv --list 2>/dev/null | command sed -e "s@//@@;" 2>/dev/null))
6161
if ((${#cp[@]})); then
6262
if [[ $cur == "${cur,,}" ]]; then
63-
COMPREPLY=($(compgen -W '${cp[@],,}' -- "$cur"))
63+
COMPREPLY=($(compgen -W '"${cp[@],,}"' -- "$cur"))
6464
else
65-
COMPREPLY=($(compgen -W '${cp[@]^^}' -- "$cur"))
65+
COMPREPLY=($(compgen -W '"${cp[@]^^}"' -- "$cur"))
6666
fi
6767
fi
6868
return

completions/mysql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ _comp_xfunc_mysql_character_sets()
88
charsets=("${charsets[@]##*/}")
99
charsets=("${charsets[@]%.xml}")
1010
local IFS=$'\n'
11-
COMPREPLY+=($(compgen -W '${charsets[@]}' -X '' -- "$cur"))
11+
COMPREPLY+=($(compgen -W '"${charsets[@]}"' -X '' -- "$cur"))
1212
}
1313

1414
_comp_deprecate_func _mysql_character_sets _comp_xfunc_mysql_character_sets

0 commit comments

Comments
 (0)