Skip to content

Commit 0a2019d

Browse files
committed
fix: use _comp_split while keeping filtering by $cur
1 parent 2934977 commit 0a2019d

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

completions/_yum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ _comp_cmd_yum__list()
88
if [[ $1 == all ]]; then
99
# Try to strip in between headings like "Available Packages"
1010
# This will obviously only work for English :P
11-
COMPREPLY=($(yum -d 0 -C list "$1" "$cur*" 2>/dev/null |
11+
_comp_split COMPREPLY "$(yum -d 0 -C list "$1" "$cur*" 2>/dev/null |
1212
command sed -ne '/^Available /d' -e '/^Installed /d' \
13-
-e '/^Updated /d' -e 's/[[:space:]].*//p'))
13+
-e '/^Updated /d' -e 's/[[:space:]].*//p')"
1414
else
1515
# Drop first line (e.g. "Updated Packages")
16-
COMPREPLY=($(yum -d 0 -C list "$1" "$cur*" 2>/dev/null |
17-
command sed -ne 1d -e 's/[[:space:]].*//p'))
16+
_comp_split COMPREPLY "$(yum -d 0 -C list "$1" "$cur*" 2>/dev/null |
17+
command sed -ne 1d -e 's/[[:space:]].*//p')"
1818
fi
1919
}
2020

completions/cpan2dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ _comp_cmd_cpan2dist()
2727
[[ -d $dir && -r "$dir/02packages.details.txt.gz" ]] &&
2828
packagelist="$dir/02packages.details.txt.gz"
2929
done
30-
[[ $packagelist ]] && COMPREPLY=($(zgrep "^${cur//-/::}" \
30+
[[ $packagelist ]] && _comp_split COMPREPLY "$(zgrep "^${cur//-/::}" \
3131
"$packagelist" 2>/dev/null | _comp_awk '{print $1}' |
32-
command sed -e 's/::/-/g'))
32+
command sed -e 's/::/-/g')"
3333
fi
3434
} &&
3535
complete -F _comp_cmd_cpan2dist -o default cpan2dist

completions/make

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,10 @@ _comp_cmd_make()
154154
# mode=-d # display-only mode
155155
# fi
156156

157-
local IFS=$' \t\n'
158-
COMPREPLY=($(LC_ALL=C \
157+
_comp_split COMPREPLY "$(LC_ALL=C \
159158
$1 -npq __BASH_MAKE_COMPLETION__=1 \
160159
${makef+"${makef[@]}"} "${makef_dir[@]}" .DEFAULT 2>/dev/null |
161-
_comp_cmd_make__extract_targets "$mode" "$cur"))
160+
_comp_cmd_make__extract_targets "$mode" "$cur")"
162161

163162
_comp_cmd_make__truncate_non_unique_paths
164163

completions/vncviewer

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,13 @@ _comp_cmd_xvnc4viewer()
8383
WMDecorationWidth ZlibLevel)
8484
[[ $cur == --* ]] && dash=-- || dash=-
8585

86-
local IFS=$' \t\n'
87-
COMPREPLY=($(
86+
_comp_split COMPREPLY "$(
8887
shopt -s nocasematch
8988
local option
9089
for option in "${options[@]}"; do
9190
[[ $dash$option == "$cur"* ]] && printf '%s\n' "$dash$option"
9291
done
93-
))
92+
)"
9493
else
9594
_comp_compgen_known_hosts -- "$cur"
9695
fi

0 commit comments

Comments
 (0)