Skip to content

Commit 3d12485

Browse files
committed
style: remove unnecessary quoting of comsub in assignment rhs
As suggested in Ref. [1]. [1] \ scop#1564 (comment)
1 parent bc5dfff commit 3d12485

File tree

15 files changed

+30
-30
lines changed

15 files changed

+30
-30
lines changed

completions-core/bk.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ _comp_cmd_bk()
66
local cur prev words cword comp_args
77
_comp_initialize -- "$@" || return
88

9-
local BKCMDS="$(bk help topics 2>/dev/null |
10-
_comp_awk '/^ bk/ { print $2 }' | xargs printf '%s ')"
9+
local BKCMDS=$(bk help topics 2>/dev/null |
10+
_comp_awk '/^ bk/ { print $2 }' | xargs printf '%s ')
1111

1212
_comp_compgen -- -W "$BKCMDS"
1313
_comp_compgen -a filedir

completions-core/feh.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _comp_cmd_feh()
2828
return
2929
fi
3030
local font_path
31-
# font_path="$(imlib2-config --prefix 2>/dev/null)/share/imlib2/data/fonts"
31+
# font_path=$(imlib2-config --prefix 2>/dev/null)/share/imlib2/data/fonts
3232
# _comp_compgen -C "$font_path" -- -f -X "!*.[tT][tT][fF]" -S /
3333
for ((i = ${#words[@]} - 2; i > 0; i--)); do
3434
if [[ ${words[i]} == -@(C|-fontpath) ]]; then

completions-core/ip.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ _comp_cmd_ip()
567567
_comp_cmd_ip__netns "$1"
568568
else
569569
local offset
570-
offset="$((subcword + 2 - all_offset))"
570+
offset=$((subcword + 2 - all_offset))
571571
_comp_command_offset "$offset"
572572
fi
573573
;;

completions-core/mr.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ _comp_cmd_mr()
77

88
local help commands options
99

10-
help="$(PERLDOC_PAGER=cat PERLDOC=-otext "${1}" help 2>/dev/null)"
10+
help=$(PERLDOC_PAGER=cat PERLDOC=-otext "${1}" help 2>/dev/null)
1111

12-
commands="$(
12+
commands=$(
1313
# shellcheck disable=SC2030
1414
printf %s "$help" | while read -r _ options cmd _; do
1515
[[ $options != "[options]" ]] || printf "%s\n" "$cmd"
1616
done
17-
)"
17+
)
1818
# Split [online|offline] and remove `action` placeholder.
1919
commands="${commands//@(action|[\[\|\]])/ }"
2020
# Add standard aliases.

completions-core/mutt.bash

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ _comp_cmd_mutt__query()
101101
[[ $cur ]] || return 0
102102
local muttcmd=${words[0]}
103103

104-
local querycmd="$("$muttcmd" -Q query_command 2>/dev/null | command sed -e 's|^query_command="\(.*\)"$|\1|' -e 's|%s|'"$cur"'|')"
104+
local querycmd=$("$muttcmd" -Q query_command 2>/dev/null | command sed -e 's|^query_command="\(.*\)"$|\1|' -e 's|%s|'"$cur"'|')
105105
if [[ $querycmd ]]; then
106106
local REPLY
107107
_comp_expand_tilde "$querycmd"
@@ -120,7 +120,7 @@ _comp_cmd_mutt__filedir()
120120
_comp_cmd_mutt__get_muttrc
121121
muttrc=$REPLY
122122
if [[ $cur == [=+]* ]]; then
123-
folder="$("$muttcmd" -F "$muttrc" -Q folder 2>/dev/null | command sed -e 's|^folder="\(.*\)"$|\1|')"
123+
folder=$("$muttcmd" -F "$muttrc" -Q folder 2>/dev/null | command sed -e 's|^folder="\(.*\)"$|\1|')
124124
[[ $folder ]] || folder=~/Mail
125125

126126
# Match any file in $folder beginning with $cur
@@ -130,8 +130,8 @@ _comp_cmd_mutt__filedir()
130130
COMPREPLY=("${COMPREPLY[@]#"$folder"/}")
131131
return
132132
elif [[ $cur == !* ]]; then
133-
spoolfile="$("$muttcmd" -F "$muttrc" -Q spoolfile 2>/dev/null |
134-
command sed -e 's|^spoolfile="\(.*\)"$|\1|')"
133+
spoolfile=$("$muttcmd" -F "$muttrc" -Q spoolfile 2>/dev/null |
134+
command sed -e 's|^spoolfile="\(.*\)"$|\1|')
135135
if [[ $spoolfile ]]; then
136136
_comp_dequote "\"$spoolfile\"" && spoolfile=$REPLY
137137
cur=$spoolfile${cur:1}

completions-core/openssl.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ _comp_cmd_openssl()
4747
if ((cword == 1)); then
4848
local commands
4949
# We only want the standard commands, so we delete everything starting after and including "Message Digest commands"
50-
commands="$("$1" help 2>&1 | command sed -e '/Standard commands/d;/help:/d' -e '/Message Digest commands/,$d')"
50+
commands=$("$1" help 2>&1 | command sed -e '/Standard commands/d;/help:/d' -e '/Message Digest commands/,$d')
5151
_comp_compgen -- -W "$commands"
5252
else
5353
command=${words[1]}

completions-core/p4.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _comp_cmd_p4()
99
local p4commands p4filetypes
1010

1111
# rename isn't really a command
12-
p4commands="$(p4 help commands 2>/dev/null | _comp_awk 'NF>3 {print $1}')"
12+
p4commands=$(p4 help commands 2>/dev/null | _comp_awk 'NF>3 {print $1}')
1313
p4filetypes="ctext cxtext ktext kxtext ltext tempobj ubinary \
1414
uresource uxbinary xbinary xltext xtempobj xtext \
1515
text binary resource"

completions-core/pylint.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ _comp_cmd_pylint__message_ids()
88
# TODO(scop): The fallback here is slow, maybe memoize whether
99
# --list-msgs-enabled worked (>= 2.4.0) and avoid unnecessary tries
1010
# again later?
11-
local msgs="$(
11+
local msgs=$(
1212
set -o pipefail
1313
"$1" --list-msgs-enabled 2>/dev/null |
1414
command sed -ne "$filter" |
1515
command sed -ne 's/^[[:space:]]\{1,\}\([a-z-]\{6,\}\).*/\1/p' ||
1616
"$1" --list-msgs 2>/dev/null |
1717
command sed -ne 's/^:\([a-z-]\{6,\}\).*/\1/p'
18-
)"
18+
)
1919
_comp_delimited , -W "$msgs"
2020
}
2121

completions-core/ri.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ _comp_cmd_ri()
7777
# which version of ri are we using?
7878
# -W0 is required here to stop warnings from older versions of ri
7979
# from being captured when used with Ruby 1.8.1 and later
80-
ri_version="$(ruby -W0 "$ri_path" -v 2>&1)" || ri_version=integrated
80+
ri_version=$(ruby -W0 "$ri_path" -v 2>&1) || ri_version=integrated
8181
[[ $ri_version != "${ri_version%200*}" ]] && ri_version=integrated
8282
[[ $ri_version =~ ri[[:space:]]v?([0-9]+) ]] && ri_major=${BASH_REMATCH[1]}
8383

completions-core/tar.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ _comp_cmd_tar__posix()
803803
_comp_cmd_tar()
804804
{
805805
local cmd=${COMP_WORDS[0]} func line
806-
line="$("$cmd" --version 2>/dev/null)"
806+
line=$("$cmd" --version 2>/dev/null)
807807
case "$line" in
808808
*GNU*)
809809
func=_comp_cmd_tar__gnu

0 commit comments

Comments
 (0)