This program shouldn't know about file names. If that is wanted, use
something like `find ... | grep ... | xargs grepc ...`.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
# Defaults:
-git='no';
FILES='.';
iflag='';
lflag='';
grepc_parse_cmd()
{
- while getopts "cghiklt:" opt; do
+ while getopts "chiklt:" opt; do
case "$opt" in
c)
cflag='yes';
;;
- g)
- git='yes';
- ;;
h)
echo "Usage: $0 [OPTION ...] IDENTIFIER [FILE ...]";
exit 0;
grepc_find_files()
{
- if [ "$git" = 'yes' ]; then
- git ls-files $FILES;
- else
- find $FILES -type f;
- fi \
+ find $FILES -type f \
| xargs grep -${iflag}lPI -- "$1" \
| tee "$files_use" \
| xargs grep -${iflag}lP -- "$1\b" \
.RB ( u\fI*\fP )
are highlighted.
.TP
-.B \-g
-Restrict the search to files tracked by git.
-.TP
.B \-h
Output a help message and exit.
.TP
Alejandro Colomar
.ME .
.SH SEE ALSO
-.MR git-ls-files 1 ,
.MR pcre2grep 1 ,
.MR pcresyntax 3 ,
.MR pcrepattern 3