diff options
author | Junio C Hamano <junkio@cox.net> | 2005-12-14 13:01:01 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-12-14 13:01:01 -0800 |
commit | b0d3e9baaa16c805ef941e8f26d55fb23f091ef5 (patch) | |
tree | 142e8fb76c906de7b61b9bf55ab026bee2388aa3 /git-grep.sh | |
parent | Documentation: topic branches (diff) | |
parent | applypatch: no need to do non-portable [[ ... ]] (diff) | |
download | tgif-b0d3e9baaa16c805ef941e8f26d55fb23f091ef5.tar.xz |
Merge branch 'fk/usage'
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" |