aboutsummaryrefslogtreecommitdiff
path: root/git-grep.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-12 13:24:55 -0700
committerJunio C Hamano <junkio@cox.net>2005-09-12 13:24:55 -0700
commit540bf654d007b3289adec37e3008c588ba677e25 (patch)
treec92d79d3651d43e2fde92c30b1b8af93967b86e9 /git-grep.sh
parentf22cc3fcbfe7755154a3a151215abd39162e2e85 (diff)
downloadgit-540bf654d007b3289adec37e3008c588ba677e25.tar.gz
git-540bf654d007b3289adec37e3008c588ba677e25.tar.xz
Allow finding things that begin with a dash in 'git grep'
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-grep.sh')
-rwxr-xr-xgit-grep.sh7
1 files changed, 6 insertions, 1 deletions
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"