540bf654d0
Signed-off-by: Junio C Hamano <junkio@cox.net>
26 lines
343 B
Bash
Executable File
26 lines
343 B
Bash
Executable File
#!/bin/sh
|
|
flags=
|
|
while :; do
|
|
pattern="$1"
|
|
case "$pattern" in
|
|
-i|-I|-a|-E|-H|-h|-l)
|
|
flags="$flags $pattern"
|
|
shift
|
|
;;
|
|
-e)
|
|
pattern="$2"
|
|
shift
|
|
break
|
|
;;
|
|
-*)
|
|
echo "unknown flag $pattern" >&2
|
|
exit 1
|
|
;;
|
|
*)
|
|
break
|
|
;;
|
|
esac
|
|
done
|
|
shift
|
|
git-ls-files -z "$@" | xargs -0 grep $flags -e "$pattern"
|