diff options
Diffstat (limited to 'git-grep.sh')
-rwxr-xr-x | git-grep.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/git-grep.sh b/git-grep.sh index 44c16130bd..2ed8e955d6 100755 --- a/git-grep.sh +++ b/git-grep.sh @@ -3,6 +3,10 @@ # Copyright (c) Linus Torvalds, 2005 # +USAGE='<option>... <pattern> <path>...' +SUBDIRECTORY_OK='Yes' +. git-sh-setup + pattern= flags=() git_flags=() @@ -40,8 +44,7 @@ while : ; do shift done [ "$pattern" ] || { - echo >&2 "usage: 'git grep <pattern> [pathspec*]'" - exit 1 + usage } git-ls-files -z "${git_flags[@]}" "$@" | xargs -0 grep "${flags[@]}" -e "$pattern" |