On Wed, Mar 24, 2010 at 4:14 PM, Ted Unangst <[email protected]> wrote:
> Turns out we have an -o option, but it doesn't do what most people
> expect.  That's a problem with nonstandard options, and we were probably
> lax in asserting that we really wanted these options when importing.
> oops.

(especially because -o can be emulated by adding /dev/null as a file
argument...)

Let's think about what you're proposing: "we added -o as an extension,
but now we want a *different* -o, so let's shuffle the extensions
(breaking anything using them) so that people can depend on a
different extension"  This doesn't make sense to me.

If people want to write a portable script, they should USE PORTABLE OPTIONS.
If they want to sign away their brain to GNU grep, they should INSTALL GNU
GREP.

Just swapping between non-portable extensions *reduces* portability
(by breaking portability between versions of OpenBSD) instead of
increasing it.


> Anyway, the GNU -o option seems a lot more useful than ours.  They call
> this option -H, and have no equivalent to our -H (which also seems pretty
> useless).

Our current -H option belongs together with the -R and -P options,
giving consistency across the utility set for control of recursion.

...except that that the option for always following symlinks is
normally -L but in grep it's -S because -L was already taken by a
different extension!


> This diff switches over to only printing the part of the line that
> matched, not the whole line, possibly repeating the pattern if the line
> matches twice (that's the tricky part with our code, as is).  The tangly
> gotos can be cleaned up, but I figured I should just toss this out there.

I'm opposed to this.  Sorry, Ted.


Philip Guenther

Reply via email to