Skip to content

Commit 2e22a6e

Browse files
committed
fix: replace all uses of "dequote" with "_comp_dequote"
1 parent 59fca53 commit 2e22a6e

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

bash_completion

+8-8
Original file line numberDiff line numberDiff line change
@@ -1099,12 +1099,12 @@ _parse_help()
10991099
11001100
local cmd=$1
11011101
local line rc=1
1102-
{
1102+
(
11031103
case $cmd in
1104-
-) cat ;;
1105-
*) LC_ALL=C "$(dequote "$cmd")" ${2:---help} 2>&1 ;;
1104+
-) exec cat ;;
1105+
*) _comp_dequote "$cmd" && LC_ALL=C "$ret" ${2:---help} 2>&1 ;;
11061106
esac
1107-
} |
1107+
) |
11081108
while read -r line; do
11091109
11101110
[[ $line == *([[:blank:]])-* ]] || continue
@@ -1136,12 +1136,12 @@ _parse_usage()
11361136
11371137
local cmd=$1
11381138
local line match option i char rc=1
1139-
{
1139+
(
11401140
case $cmd in
1141-
-) cat ;;
1142-
*) LC_ALL=C "$(dequote "$cmd")" ${2:---usage} 2>&1 ;;
1141+
-) exec cat ;;
1142+
*) _comp_dequote "$cmd" && LC_ALL=C "$ret" ${2:---usage} 2>&1 ;;
11431143
esac
1144-
} |
1144+
) |
11451145
while read -r line; do
11461146
11471147
while [[ $line =~ \[[[:space:]]*(-[^]]+)[[:space:]]*\] ]]; do

completions/mutt

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ _muttrc()
2020
set -- "${words[@]}"
2121
while (($# > 0)); do
2222
if [[ $1 == -F* ]]; then
23+
local ret
2324
if ((${#1} > 2)); then
24-
muttrc="$(dequote "${1:2}")"
25+
_comp_dequote "${1:2}" && muttrc=$ret
2526
else
2627
shift
27-
[[ $1 ]] && muttrc="$(dequote "$1")"
28+
[[ $1 ]] && _comp_dequote "$1" && muttrc=$ret
2829
fi
2930
break
3031
fi

completions/pkgadd

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ _pkgadd()
4949
done
5050
pkginst_list="${tmplist[*]}"
5151
else
52-
pkginst_list="$(strings "$(dequote $device)" |
52+
local ret
53+
_comp_dequote "$device"
54+
pkginst_list="$(strings "$ret" |
5355
command grep ^PKG= | sort -u | cut -d= -f2)"
5456
fi
5557
COMPREPLY=($(compgen -W "$pkginst_list" -- ${cur}))

completions/pkgutil

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ _pkgutil()
2929
local catalog=$(_pkgutil_url2catalog "$url")
3030
catalog_files=("$catalog")
3131
elif [[ ${words[i]} == --config ]]; then
32-
configuration_files=("$(dequote ${words[i + 1]})")
32+
local ret
33+
_comp_dequote "${words[i + 1]}"
34+
[[ ${ret-} ]] && configuration_files=("$ret")
3335
elif [[ ${words[i]} == -@([iurdacUS]|-install|-upgrade|-remove|-download|-available|-compare|-catalog|-stream) ]]; then
3436
command="${words[i]}"
3537
fi

completions/ssh

+3-2
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,12 @@ _ssh_configfile()
233233
set -- "${words[@]}"
234234
while (($# > 0)); do
235235
if [[ $1 == -F* ]]; then
236+
local ret
236237
if ((${#1} > 2)); then
237-
configfile="$(dequote "${1:2}")"
238+
_comp_dequote "${1:2}" && configfile=$ret
238239
else
239240
shift
240-
[[ ${1-} ]] && configfile="$(dequote "$1")"
241+
[[ ${1-} ]] && _comp_dequote "$1" && configfile=$ret
241242
fi
242243
break
243244
fi

0 commit comments

Comments
 (0)