Skip to content

Commit df59a49

Browse files
committed
style(feh,upgradepkg,valgrind): remove unnecesasry @(...)
#1297 (comment)
1 parent 450d32f commit df59a49

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

completions/feh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ _comp_cmd_feh()
2929
fi
3030
local font_path
3131
# font_path="$(imlib2-config --prefix 2>/dev/null)/share/imlib2/data/fonts"
32-
# _comp_compgen -C "$font_path" -- -f -X "!*.@([tT][tT][fF])" -S /
32+
# _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
3535
font_path="${words[i + 1]}"
3636
if [[ -d $font_path ]]; then
3737
_comp_compgen -aC "$font_path" -- \
38-
-f -X "!*.@([tT][tT][fF])" -S /
38+
-f -X "!*.[tT][tT][fF]" -S /
3939
fi
4040
fi
4141
done

completions/upgradepkg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ _comp_cmd_upgradepkg()
1515
cur="${cur#*%}"
1616
local nofiles=""
1717
compopt -o filenames
18-
_comp_compgen -- -P "$prev%" -f -X "!*.@(t[bgxl]z)" || nofiles=set
18+
_comp_compgen -- -P "$prev%" -f -X "!*.t[bgxl]z" || nofiles=set
1919
_comp_compgen -a -- -P "$prev%" -S '/' -d
2020
[[ $nofiles ]] && compopt -o nospace
2121
return

completions/valgrind

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ _comp_cmd_valgrind()
77

88
local i
99
for ((i = 1; i <= cword; i++)); do
10-
if [[ ${words[i]} != @([-=])* ]]; then
10+
if [[ ${words[i]} != [-=]* ]]; then
1111
_comp_command_offset $i
1212
return
1313
fi

test/runLint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ gitgrep '(?<!command)'"$cmdstart"'(grep|ls|sed|cd)(\s|$)' \
5252
gitgrep '(?<!command)'"$cmdstart"'awk(\s|$)' \
5353
'invoke awk through "_comp_awk"'
5454

55+
gitgrep '@\([^()|$]+\)' \
56+
'@(...) may not be needed when ... does not contain |.'
57+
5558
#------------------------------------------------------------------------------
5659
# Bash pitfalls/styles/compatibilities (which are not detected by shellcheck)
5760

0 commit comments

Comments
 (0)