From 420d354fffa1e69f050ba32d8521c6d84c4f8dd1 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 1 Nov 2024 21:09:00 +0100 Subject: Add the -L/--line-position option --- src/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3