repo.or.cz
/
git
/
fastimport.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[PATCH] Make sure we die if we don't get enough arguments.
[git/fastimport.git]
/
git-grep.sh
blob
c77a2d0067246092aa0ab38f74b885ed8b51d116
1
#!/bin/sh
2
flags
=
3
while
:;
do
4
pattern
=
"
$1
"
5
case
"
$pattern
"
in
6
-i
|
-I
|
-a
|
-E
|
-H
|
-h
|
-l
)
7
flags
=
"
$flags
$pattern
"
8
shift
9
;;
10
-e
)
11
pattern
=
"
$2
"
12
shift
13
break
14
;;
15
-*)
16
echo
"unknown flag
$pattern
"
>&
2
17
exit
1
18
;;
19
*)
20
break
21
;;
22
esac
23
done
24
shift
25
git-ls-files
-z
"$@"
|
xargs
-0
grep
$flags
-e
"
$pattern
"