X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-grep.sh;h=44c16130bd93fea8b6f172f1614115801f8df2d9;hb=562051809589574576971c53c23aad93f8c395d9;hp=e7a35ebd707c6ef485a26f4e1ece57fa248e0106;hpb=c9fc748f84857a237f47deb91f87499e82865c83;p=git.git diff --git a/git-grep.sh b/git-grep.sh index e7a35ebd..44c16130 100755 --- a/git-grep.sh +++ b/git-grep.sh @@ -39,5 +39,9 @@ while : ; do esac shift done +[ "$pattern" ] || { + echo >&2 "usage: 'git grep [pathspec*]'" + exit 1 +} git-ls-files -z "${git_flags[@]}" "$@" | xargs -0 grep "${flags[@]}" -e "$pattern"