Skip to content

Commit

Permalink
Add -e to grep options in bin/regex-grep*
Browse files Browse the repository at this point in the history
If a search pattern is sent to grep that starts with a hyphen, grep will
fail.  This commit adds the '-e' flag to grep signaling that the next
option (\"__CUSTOM_OPT_PLACEHOLDER__\") is the search pattern.
  • Loading branch information
Wes Dean committed Jan 7, 2020
1 parent 36e9d1e commit e3ecd09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/regex-grep
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DEFAULT_CUST_OPS=""
# This will be replaced either with custom options
# or with the default options.

MY_CHECK="grep --color=always -inHE \"__CUSTOM_OPT_PLACEHOLDER__\" \"\$1\" || true"
MY_CHECK="grep --color=always -inHE -e \"__CUSTOM_OPT_PLACEHOLDER__\" \"\$1\" || true"

# Can this check fix the problems?
ENABLE_FIX=0
Expand Down
2 changes: 1 addition & 1 deletion bin/regex-grep-negative
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DEFAULT_CUST_OPS=""
# This will be replaced either with custom options
# or with the default options.

MY_CHECK="grep -iLE \"__CUSTOM_OPT_PLACEHOLDER__\" \"\$1\" || true"
MY_CHECK="grep -iLE -e \"__CUSTOM_OPT_PLACEHOLDER__\" \"\$1\" || true"

# Can this check fix the problems?
ENABLE_FIX=0
Expand Down

0 comments on commit e3ecd09

Please sign in to comment.