summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-11-05 13:23:29 +0100
committerAlejandro Colomar <alx@kernel.org>2023-11-05 17:12:39 +0100
commitab07b22a4dd31ccb9beef150fd478c1f8ce6bf31 (patch)
tree93b3c42624a4d104c2f68c957965efa17b098249 /bin
parentbc6d82d8172cfa743438e441cef0f2e59aed2f19 (diff)
bin/grepc, grepc.1: Rename option -c to -r
This leaves -c unused, so we can add -c with the same meaning of grep(1): count. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/grepc12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/grepc b/bin/grepc
index b0145ca..c8e49ca 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -5,12 +5,12 @@
A='';
B='';
C='';
-c='no';
h='-H';
i='';
k='no';
l='';
n='';
+r='no';
t='no';
t_e='no';
t_fp='no';
@@ -44,7 +44,7 @@ grepc_err()
grepc_parse_cmd()
{
- while getopts "A:B:C:chiklnt:" opt; do
+ while getopts "A:B:C:hiklnrt:" opt; do
case "$opt" in
A)
A="-A$OPTARG";
@@ -55,9 +55,6 @@ grepc_parse_cmd()
C)
C="-C$OPTARG";
;;
- c)
- c='yes';
- ;;
h)
h='-h';
;;
@@ -74,6 +71,9 @@ grepc_parse_cmd()
n)
n='-n';
;;
+ r)
+ r='yes';
+ ;;
t)
case "$OPTARG" in
e)
@@ -276,7 +276,7 @@ main()
grepc_search \
| sed -E -f <(test "$k" = 'no' && echo 's/^[^: ]+:[0-9]+:/\n\n&\n/') \
- | perl -pe "$(test "$c" = 'yes' && echo 's/('"$identifier"')/\033[32m\1\033[0m/' || echo 's///')" \
+ | perl -pe "$(test "$r" = 'yes' && echo 's/('"$identifier"')/\033[32m\1\033[0m/' || echo 's///')" \
| if [ -n "$l" ]; then
sort \
| uniq;