GNU bug report logs - #36612
Expand "no" options

Previous Next

Package: grep;

Reported by: Steven Penny <svnpenn <at> gmail.com>

Date: Fri, 12 Jul 2019 01:13:02 UTC

Severity: wishlist

To reply to this bug, email your comments to 36612 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#36612; Package grep. (Fri, 12 Jul 2019 01:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Penny <svnpenn <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Fri, 12 Jul 2019 01:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Steven Penny <svnpenn <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: Expand "no" options
Date: Thu, 11 Jul 2019 18:12:17 -0700 (PDT)
Grep does not have a way to disable "-i", "-n" or "-r" options. Those options
could look like this:

   -N, --no-line-number
   -O, --no-ignore-case
   -S, --no-recursive

The single letter choices are not ideal, but "-I" and "-R" were already taken.
If these options existed, you could write a function like this:

   grep_bravo() {
      grep -i -n -r "$@"
   }

then if you passed the new arguments like this:

   grep_bravo -N -O -S charlie delta.txt

your arguments would override the function arguments, as they come after.





Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Thu, 02 Jan 2020 09:42:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-grep <at> gnu.org:
bug#36612; Package grep. (Mon, 21 Mar 2022 14:22:02 GMT) Full text and rfc822 format available.

Message #10 received at 36612 <at> debbugs.gnu.org (full text, mbox):

From: ruoshu gao <bei540296467 <at> yahoo.com>
To: "36612 <at> debbugs.gnu.org" <36612 <at> debbugs.gnu.org>
Subject: patch for "--no-line-number" and "--no-recursive" options
Date: Mon, 21 Mar 2022 11:49:14 +0000 (UTC)
[Message part 1 (text/plain, inline)]
So I tried to write a patch for "--no-line-number" and "--no-recursive" options, and I think they need no short options like -N/-R.
[Message part 2 (text/html, inline)]
[0001-add-no-line-number-and-no-recursive-option.patch (application/octet-stream, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#36612; Package grep. (Mon, 21 Mar 2022 15:32:02 GMT) Full text and rfc822 format available.

Message #13 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gary Johnson <garyjohn <at> spocom.com>
To: bug-grep <at> gnu.org
Subject: Re: bug#36612: Expand "no" options
Date: Mon, 21 Mar 2022 08:32:27 -0700
On 2019-07-11, Steven Penny wrote:
> Grep does not have a way to disable "-i", "-n" or "-r" options. Those options
> could look like this:
> 
>    -N, --no-line-number
>    -O, --no-ignore-case
>    -S, --no-recursive
> 
> The single letter choices are not ideal, but "-I" and "-R" were already taken.
> If these options existed, you could write a function like this:
> 
>    grep_bravo() {
>       grep -i -n -r "$@"
>    }
> 
> then if you passed the new arguments like this:
> 
>    grep_bravo -N -O -S charlie delta.txt
> 
> your arguments would override the function arguments, as they come after.

It seems just as easy to execute

    command grep charlie delta.txt

Regards,
Gary





This bug report was last modified 3 years and 83 days ago.

Previous Next


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