Subject: bug#75582: closed (Re: bug#75582: GNU grep 3.4 —enhancing manual)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 16 Jan 2025 05:03:02 +0000

Your bug report

#75582: GNU grep 3.4 — enhancing manual

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
75582: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75582
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#75582: GNU grep 3.4 — enhancing manual
From: Jim Meyering <[email-masked]>
To: sur-behoffski <[email-masked]>
Cc: [email-masked]
Date: Wed, 15 Jan 2025 21:02:34 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

On Wed, Jan 15, 2025 at 8:16 PM sur-behoffski
<[email-masked]> 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.

Subject: GNU grep 3.4 — enhancing manual
From: Anton Samokat <[email-masked]>
To: [email-masked]
Date: Wed, 15 Jan 2025 13:51:00 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello

In *man grep* page, in the beginning, in the *description* section, 
there is phrase:

/A FILE of “-” stands for standard input.  If no FILE is given, 
recursive searches examine the  working  directory, and  nonrecursive
        searches read standard input./

This is for GNU grep 3.4 in Ubuntu 20.04. At first read I thought that 
this phrase is non accurate, that it have mistakes. I read and 
understand it as follows:

/    If no FILE is given, recursively examine the working directory, and 
nonrecursively read standard input./

/Which does not have sense./

/But t/his phrase is accurate and means the following: _If no FILE is 
given, recursive searches (grep with -r option), examine the working 
directory; nonrecursive searches (without -r option), read standard input._

Though it will be hard to get for non experienced user. Please, make it 
more simple and straightforward, remove possible ambiguity. You can use 
my version above or correct it as you prefer.

As I understand this ambiguity created related discussion on Unix & 
Linux Stack Exchange: Why is "grep keyword" causing the terminal to 
stand by forever? — https://unix.stackexchange.com/a/789609/585416

Thanks, Anton.