bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: --only-match


From: Paul Eggert
Subject: Re: --only-match
Date: Tue, 8 May 2001 10:32:19 -0700 (PDT)

> From: "Alain Magloire" <address@hidden>
> Date: Tue, 8 May 2001 12:59:50 -0400 (EDT)
> 
> My english writing skills are flaky but "--only-match" does not sound right.
> Sorry I do not have any better alternative.

Perhaps "--context=-1"?  In some sense it's the logical successor to
"--context=0".  Or perhaps you'd prefer "--context=match-only" or
something like that.

If I understand it correctly, the proposed code prints just the first
match in each line.  This doesn't sound right to me: it should print
each match that it finds.  This raises the issue of whether it should
print overlapping matches; presumably it should.  It also raises the
issue of how many empty strings occur in a file: presumably it's only
one per input character, as otherwise 'grep' would loop.

Also, the option needs to be tested in combination with other options.
For example, from looking at the patch it appears to me that the
option does not work correctly if you also ask for the match to be
printed in color.

(I know, I know, it's just more for your to-do list.  :-)



reply via email to

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