Skip to content

Commit 54350bc

Browse files
akinomyogascop
authored andcommitted
test(runLint): check "cmdstart" more precisely
1 parent f3f454c commit 54350bc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test/runLint

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if ! cd "$(dirname "$0")/.."; then
2525
exit 1
2626
fi
2727

28-
cmdstart='(^|[[:space:];&|]|\()'
28+
cmdstart='(?:(?:^|[;&|()])[[:blank:]]*|\b(?:if|then|elif|else|for|while|until|do|coproc|command|builtin)[[:blank:]]+|{[[:blank:]]+)'
2929
filter_out=
3030

3131
# Note: Since we started to use _comp_{awk,tail}, we do not have to care about
@@ -60,10 +60,10 @@ gitgrep "$cmdstart"'[ef]grep\b' \
6060
# TODO: $ in sed subexpression used as an anchor (POSIX BRE optional, not in
6161
# Solaris/FreeBSD)
6262

63-
filter_out="test/fixtures/_longopt/grep--help.txt" gitgrep '(?<!command)'"$cmdstart"'(grep|ls|sed|cd)(\s|$)' \
63+
filter_out="test/fixtures/_longopt/grep--help.txt" gitgrep "${cmdstart/|command|/|}"'(grep|ls|sed|cd)(\s|$)' \
6464
'invoke grep, ls, sed, and cd through "command", e.g. "command grep"'
6565

66-
gitgrep '(?<!command)'"$cmdstart"'(?:awk|tail)(\s|$)' \
66+
gitgrep "${cmdstart/|command|/|}"'(?:awk|tail)(\s|$)' \
6767
'invoke awk/tail through "_comp_{awk,tail}"'
6868

6969
gitgrep '@\([^()|$]+\)' \

0 commit comments

Comments
 (0)