Thanks for reporting that. I installed the attached patch.
From 13fd8279e5fdd15ba711cf6e5eadeece89e85909 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Sat, 5 Aug 2023 14:58:09 -0700
Subject: [PATCH] doc: clarify -- role

This should fix bug#65046 reported by Helmut Waltzmann.
---
 doc/grep.in.1 |  4 ++--
 doc/grep.texi | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/grep.in.1 b/doc/grep.in.1
index 236791e..01f753a 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -1299,7 +1299,7 @@ contain \*(lqg\*(rq and end in \*(lq.h\*(rq.
 The
 .B \-n
 option outputs line numbers, the
-.B \-\-
+.B \-\^\-
 argument treats expansions of \*(lq*g*.h\*(rq starting with \*(lq\-\*(rq
 as file names not options,
 and the empty file /dev/null causes file names to be output
@@ -1307,7 +1307,7 @@ even if only one file name happens to be of the form \*(lq*g*.h\*(rq.
 .PP
 .in +2n
 .EX
-$ \fBgrep\fP \-n \-\- 'f.*\e.c$' *g*.h /dev/null
+$ \fBgrep\fP \-n \-\^\- 'f.*\e.c$' *g*.h /dev/null
 argmatch.h:1:/* definitions and prototypes for argmatch.c
 .EE
 .in
diff --git a/doc/grep.texi b/doc/grep.texi
index 594ac1f..42b499a 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -555,7 +555,7 @@ Print @var{num} lines of leading and trailing output context.
 @opindex --group-separator
 @cindex group separator
 When @option{-A}, @option{-B} or @option{-C} are in use,
-print @var{string} instead of @option{--} between groups of lines.
+print @var{string} instead of @samp{--} between groups of lines.
 
 @item --no-group-separator
 @opindex --group-separator
@@ -770,10 +770,10 @@ directory, recursively, following all symbolic links.
 @item --
 @opindex --
 @cindex option delimiter
-Delimit the option list.  Later arguments, if any, are treated as
-operands even if they begin with @samp{-}.  For example, @samp{grep PAT --
--file1 file2} searches for the pattern PAT in the files named @file{-file1}
-and @file{file2}.
+Delimit the option list.  Any later argument is not treated as an
+option even if it begins with @samp{-}.  For example,
+@samp{grep -- -PAT -file1 file2} searches for the pattern @samp{-PAT}
+in the files named @file{-file1} and @file{file2}.
 
 @item --line-buffered
 @opindex --line-buffered
-- 
2.39.2

Reply via email to