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