aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-11-01 21:09:00 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-11-01 21:09:08 +0100
commit420d354fffa1e69f050ba32d8521c6d84c4f8dd1 (patch)
treed00031c5b9ef43c4214545e7df50219ead172148 /src
parent3d81225658411823a3f8ae44e9276797b52ead4c (diff)
Add the -L/--line-position option
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 36b1349..a71b554 100644
--- a/src/main.c
+++ b/src/main.c
@@ -71,6 +71,7 @@ main(int argc, char **argv)
{'h', U8C("help"), CLI_NONE},
{'i', U8C("ignore-case"), CLI_NONE},
{'l', U8C("literal"), CLI_NONE},
+ {'L', U8C("line-position"), CLI_NONE},
{'p', U8C("predicate"), CLI_NONE},
{'s', U8C("strip-newline"), CLI_NONE},
{'U', U8C("no-unicode"), CLI_NONE},
@@ -84,6 +85,9 @@ main(int argc, char **argv)
switch (opt) {
case 'b':
flags.b = true;
+#if !GIT_GRAB
+ flags.do_header = true;
+#endif
break;
case 'c':
flags.c = true;
@@ -97,6 +101,12 @@ main(int argc, char **argv)
case 'l':
flags.l = true;
break;
+ case 'L':
+ flags.b = false;
+#if !GIT_GRAB
+ flags.do_header = true;
+#endif
+ break;
case 'p':
flags.p = true;
break;
@@ -120,7 +130,7 @@ main(int argc, char **argv)
if (argc == 0) {
usage:
- usage("[-p | -s | -z] [-bcilU] pattern [file ...]", "-h");
+ usage("[-bcilLpsUz] pattern [file ...]", "-h");
exit(EXIT_FATAL);
}