GNU bug report logs - #75582
GNU grep 3.4 — enhancing manual

Previous Next

Package: grep;

Reported by: Anton Samokat <samokat700 <at> gmail.com>

Date: Wed, 15 Jan 2025 14:37:03 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 75582-done <at> debbugs.gnu.org (full text, mbox):

From: "David G. Pickett" <dgpickett <at> aol.com>
To: sur-behoffski <sur-behoffski <at> grouse.com.au>, 
 Jim Meyering <jim <at> meyering.net>
Cc: "75582-done <at> debbugs.gnu.org" <75582-done <at> debbugs.gnu.org>
Subject: Re: bug#75582: GNU grep 3.4 — enhancing manual
Date: Fri, 17 Jan 2025 18:30:41 +0000 (UTC)
[Message part 1 (text/plain, inline)]
With is rather like if ... else .... so maybe:


When FILE is '-', read standard input.  If no FILE is given, with -r, recursively search the working directory instead, else read standard input.  With fewer than two FILEs, assume -h.  Exit status is 0 if any line is selected, 1 otherwise; if any error occurs and -q is not given, the exit status is 2.


 

    On Thursday, January 16, 2025 at 12:03:41 AM EST, Jim Meyering <jim <at> meyering.net> wrote:   

 On Wed, Jan 15, 2025 at 8:16 PM sur-behoffski
<sur-behoffski <at> grouse.com.au> wrote:
> On 2025-01-16 08:05, Paul Eggert wrote:
> > On 2025-01-15 02:51, Anton Samokat wrote:
> >> Please, make it more simple and straightforward, remove possible ambiguity
> >
> > Unfortunately these are competing goals.
> >
> > Perhaps this would be better:
> >
> > If no FILE is given read standard input, but if -r is given recursively
> > search the working directory instead.
> > [...]
>
> Interesting.  How about:
>
>    If no FILE is given, grep's behaviour depends on the -r (recursive)
>    option, which is disabled (non-recursive) by default:
>
>        - If non-recursive, then read standard input; otherwise
>        - If recursive, examine all files in the working directory,
>          including recursively descending into subdirectories.
>
> No idea if this is good, bad, or indifferent... others can decide.

Thanks for the suggestions. I went with Paul's (keeping it concise is
important), so --help now prints this:

When FILE is '-', read standard input.  If no FILE is given, read standard
input, but with -r, recursively search the working directory instead.  With
fewer than two FILEs, assume -h.  Exit status is 0 if any line is selected,
1 otherwise; if any error occurs and -q is not given, the exit status is 2.

Here's the commit:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=v3.11-56-gfc6aba9

Marking this as done.



  
[Message part 2 (text/html, inline)]

This bug report was last modified 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.