Skip to content

Commit 1d3add4

Browse files
committed
*: address shellcheck SC2046
1 parent bef80ef commit 1d3add4

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

bash_completion

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ __parse_options()
813813
#
814814
_parse_help()
815815
{
816-
eval local cmd=$(quote "$1")
816+
eval local cmd="$(quote "$1")"
817817
local line
818818
{ case $cmd in
819819
-) cat ;;
@@ -838,7 +838,7 @@ _parse_help()
838838
#
839839
_parse_usage()
840840
{
841-
eval local cmd=$(quote "$1")
841+
eval local cmd="$(quote "$1")"
842842
local line match option i char
843843
{ case $cmd in
844844
-) cat ;;
@@ -1034,7 +1034,7 @@ _tilde()
10341034
__expand_tilde_by_ref()
10351035
{
10361036
if [[ ${!1} == \~* ]]; then
1037-
eval $1=$(printf ~%q "${!1#\~}")
1037+
eval $1="$(printf ~%q "${!1#\~}")"
10381038
fi
10391039
} # __expand_tilde_by_ref()
10401040

@@ -1050,7 +1050,7 @@ _expand()
10501050
if [[ "$cur" == \~*/* ]]; then
10511051
__expand_tilde_by_ref cur
10521052
elif [[ "$cur" == \~* ]]; then
1053-
_tilde "$cur" || eval COMPREPLY[0]=$(printf ~%q "${COMPREPLY[0]#\~}")
1053+
_tilde "$cur" || eval COMPREPLY[0]="$(printf ~%q "${COMPREPLY[0]#\~}")"
10541054
return ${#COMPREPLY[@]}
10551055
fi
10561056
}
@@ -1565,10 +1565,10 @@ _known_hosts_real()
15651565
cur=${!OPTIND}; (( OPTIND += 1 ))
15661566
if [[ $# -ge $OPTIND ]]; then
15671567
echo "bash_completion: $FUNCNAME($*): unprocessed arguments:" \
1568-
$(while [[ $# -ge $OPTIND ]]; do
1569-
printf '%s\n' ${!OPTIND}
1568+
"$(while [[ $# -ge $OPTIND ]]; do
1569+
printf '%s ' ${!OPTIND}
15701570
shift
1571-
done) >&2
1571+
done)" >&2
15721572
return 1
15731573
fi
15741574

completions/7z

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ _7z()
109109
else
110110
if [[ ${words[1]} == d ]]; then
111111
local IFS=$'\n'
112-
COMPREPLY=( $(compgen -W "$(printf '%s\n' $($1 l ${words[2]} \
112+
COMPREPLY=( $(compgen -W "$(printf '%s\n' "$($1 l ${words[2]} \
113113
-slt 2>/dev/null | command sed -n '/^Path =/s/^Path = \(.*\)$/\1/p' \
114-
2>/dev/null | tail -n+2))" -- "$cur") )
114+
2>/dev/null | tail -n+2)")" -- "$cur") )
115115
compopt -o filenames
116116
else
117117
_filedir

completions/mutt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ _muttconffiles()
5555
sofar=" $1 "
5656
shift
5757
while [[ "$1" ]]; do
58-
newconffiles=( $(command sed -n 's|^source[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' $(eval printf %s $1) ) )
58+
newconffiles=( $(command sed -n 's|^source[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' "$(eval printf %s $1)" ) )
5959
for file in "${newconffiles[@]}"; do
6060
__expand_tilde_by_ref file
6161
[[ ! -f "$file" || $sofar == *\ $file\ * ]] && continue
@@ -78,8 +78,9 @@ _muttaliases()
7878
[[ -z $muttrc ]] && return
7979

8080
conffiles=( $(eval _muttconffiles $muttrc $muttrc) )
81-
aliases=( $(command sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \
82-
$(eval echo "${conffiles[@]}")) )
81+
# shellcheck disable=SC2046
82+
aliases=( "$(command sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \
83+
$(eval echo "${conffiles[@]}"))" )
8384
COMPREPLY+=( $(compgen -W "${aliases[*]}" -- "$cur") )
8485
}
8586

completions/pkgadd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ _pkgadd ()
4949
done
5050
pkginst_list="${tmplist[*]}"
5151
else
52-
pkginst_list=$(strings $(dequote $device) | \
53-
command grep "^PKG=" | sort -u | cut -d= -f2)
52+
pkginst_list="$(strings "$(dequote $device)" | \
53+
command grep ^PKG= | sort -u | cut -d= -f2)"
5454
fi
5555
COMPREPLY=( $(compgen -W "$pkginst_list" -- ${cur}) )
5656
fi

0 commit comments

Comments
 (0)