Subject: bug#38792: man grep

From: Stephane Chazelas <[email-masked]>
Date: Mon, 30 Dec 2019 17:54:26 +0000

2019-12-30 01:59:09 -0800, Paul Eggert:
> Thanks, I installed the attached, which is a bit more conservative than what you
> suggested but which I hope catches all the issues.
[...]
>  @example
> -grep -l 'main' *.c
> +grep -l 'main' test-*.c
>  @end example
[...]

Thanks,

though I find it's a bit of a shame to /hide/ the problem like
that here.

It's so common for people to forget that "--" (I just came
across https://en.wikipedia.org/wiki/Glob_(programming) which
does that mistake in the very first paragraph for instance) that
it would be beneficial IMO if the manual showed the right way to do,
especially for the GNU implementation of grep which makes the
problem worse by accepting options after non-option arguments.

Please consider making it

grep -l -- 'main' *.c

to raise awareness and try and teach people "the right way".

-- 
Stephane