From: Junio C Hamano Date: Mon, 12 Sep 2005 20:24:55 +0000 (-0700) Subject: Allow finding things that begin with a dash in 'git grep' X-Git-Tag: v0.99.7~68 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=540bf654d007b3289adec37e3008c588ba677e25;p=git.git Allow finding things that begin with a dash in 'git grep' Signed-off-by: Junio C Hamano --- diff --git a/git-grep.sh b/git-grep.sh index db2296c33..c77a2d006 100755 --- a/git-grep.sh +++ b/git-grep.sh @@ -7,6 +7,11 @@ while :; do flags="$flags $pattern" shift ;; + -e) + pattern="$2" + shift + break + ;; -*) echo "unknown flag $pattern" >&2 exit 1 @@ -17,4 +22,4 @@ while :; do esac done shift -git-ls-files -z "$@" | xargs -0 grep $flags "$pattern" +git-ls-files -z "$@" | xargs -0 grep $flags -e "$pattern"