From e3ecd0924e234e2bac5aadc7fde8d9cd97feb470 Mon Sep 17 00:00:00 2001 From: Wes Dean <> Date: Tue, 7 Jan 2020 13:52:25 -0500 Subject: [PATCH] Add -e to grep options in bin/regex-grep* 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. --- bin/regex-grep | 2 +- bin/regex-grep-negative | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/regex-grep b/bin/regex-grep index d6b789a..9abaa91 100755 --- a/bin/regex-grep +++ b/bin/regex-grep @@ -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 diff --git a/bin/regex-grep-negative b/bin/regex-grep-negative index 0081e87..7a2b745 100644 --- a/bin/regex-grep-negative +++ b/bin/regex-grep-negative @@ -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