[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31537: Combining -v and -A/-B/-C options

From: Paul Eggert
Subject: bug#31537: Combining -v and -A/-B/-C options
Date: Sun, 20 May 2018 18:03:04 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Garreau, Alexandre wrote:
I believe context options used in conjonction with invert-match option
should specify which lines*not to show*  along with matched then not
shown lines.

I can see it the other way. For example, "show all lines that lack signed integers, plus their context" can be done via a command like "grep -C1 -v -E '[-+][0-9]+([^.e]|$)'", and I don't see any easy way to do the same search under the changes you're proposing.

In essence you're proposing a new feature that I'd call "negative context"; i.e., if a line is not selected, then suppress the output of nearby lines that are selected. grep already has a lot of features and it's not clear this one is important enough to add.

maybe this behavior could be triggered only
if the context option were specified *after* the invert-match one

I'd prefer option order to not matter, at least when options do not simply override each other (as is the case here).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]