mirror of
https://github.com/git/git.git
synced 2024-11-25 19:04:18 +08:00
21 lines
290 B
Bash
21 lines
290 B
Bash
|
#!/bin/sh
|
||
|
flags=
|
||
|
while :; do
|
||
|
pattern="$1"
|
||
|
case "$pattern" in
|
||
|
-i|-I|-a|-E|-H|-h|-l)
|
||
|
flags="$flags $pattern"
|
||
|
shift
|
||
|
;;
|
||
|
-*)
|
||
|
echo "unknown flag $pattern" >&2
|
||
|
exit 1
|
||
|
;;
|
||
|
*)
|
||
|
break
|
||
|
;;
|
||
|
esac
|
||
|
done
|
||
|
shift
|
||
|
git-ls-files -z "$@" | xargs -0 grep $flags "$pattern"
|