Severity: minor
Tags: patch

Dear Maintainer,

It would be great if the grep.1 man page and --help usage information
included the --group-separator and --no-group-separator options (which
are already documented in grep.texi).  I've attached patches to do that.

Thanks,
Kevin
>From 20053444457c5b4d9b0855a5d06a817272b78de7 Mon Sep 17 00:00:00 2001
Message-Id: <20053444457c5b4d9b0855a5d06a817272b78de7.1618618172.git.ke...@kevinlocke.name>
From: Kevin Locke <ke...@kevinlocke.name>
Date: Fri, 16 Apr 2021 16:30:16 -0600
Subject: [PATCH 1/2] doc: man: add --group-separator/--no-group-separator

* doc/grep.in.1:
  Add copy of docs for --group-separator from doc/grep.texi.
  Add copy of docs for --no-group-separator from doc/grep.texi.
---
 doc/grep.in.1 | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/doc/grep.in.1 b/doc/grep.in.1
index c0b6b405..77c2e0ab 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -482,6 +482,26 @@ With the
 or
 .B \-\^\-only\-matching
 option, this has no effect and a warning is given.
+.TP
+.BI \-\^\-group\-separator= SEP
+When
+.BR \-A ,
+.BR \-B ,
+or
+.B \-C
+are in use, print
+.I SEP
+instead of
+.B \-\^\-
+between groups of lines.
+.TP
+.B \-\^\-no\-group\-separator
+When
+.BR \-A ,
+.BR \-B ,
+or
+.B \-C
+are in use, do not print a separator between groups of lines.
 .SS "File and Directory Selection"
 .TP
 .BR \-a ", " \-\^\-text
-- 
2.30.2

>From c1cb88a181994b524955d4fcfc5c66ea5d3ae3f8 Mon Sep 17 00:00:00 2001
Message-Id: <c1cb88a181994b524955d4fcfc5c66ea5d3ae3f8.1618618172.git.ke...@kevinlocke.name>
In-Reply-To: <20053444457c5b4d9b0855a5d06a817272b78de7.1618618172.git.ke...@kevinlocke.name>
References: <20053444457c5b4d9b0855a5d06a817272b78de7.1618618172.git.ke...@kevinlocke.name>
From: Kevin Locke <ke...@kevinlocke.name>
Date: Fri, 16 Apr 2021 18:07:19 -0600
Subject: [PATCH 2/2] doc: usage: --group-separator/--no-group-separator

* src/grep.c (usage):
  Add --group-separator to --help usage message.
  Add --no-group-separator to --help usage message.
---
 src/grep.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/grep.c b/src/grep.c
index d27d79e5..04768275 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -2048,6 +2048,8 @@ Context control:\n\
 "));
       printf (_("\
   -NUM                      same as --context=NUM\n\
+      --group-separator=SEP print SEP on line between matches with context\n\
+      --no-group-separator  do not print separator for matches with context\n\
       --color[=WHEN],\n\
       --colour[=WHEN]       use markers to highlight the matching strings;\n\
                             WHEN is 'always', 'never', or 'auto'\n\
-- 
2.30.2

Reply via email to