diff options
Diffstat (limited to 'git-grep.sh')
-rwxr-xr-x | git-grep.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/git-grep.sh b/git-grep.sh index e7a35ebd70..44c16130bd 100755 --- a/git-grep.sh +++ b/git-grep.sh @@ -39,5 +39,9 @@ while : ; do esac shift done +[ "$pattern" ] || { + echo >&2 "usage: 'git grep <pattern> [pathspec*]'" + exit 1 +} git-ls-files -z "${git_flags[@]}" "$@" | xargs -0 grep "${flags[@]}" -e "$pattern" |