From:   Collin Funk
Subject: Re: 'man grep' doesn't say what the default for --color is
Date:   Fri, 02 Jan 2026 12:46:36 -0800

>> Note: I note that 'grep' may not be part of coreutils, but it seems to
>> me that it ought to be. Hard to believe it would have a set of lists
>> just for the one program...

>It isn't a part of coreutils, but many people think it is so you are not
>alone. :)

Indeed.  Not that it is any big deal, but I didn't actually think it
was, since you can tell from the man page whether something is or
isn't, so I was just being a little coy about it.

But as I said, maybe it should be...

>Many GNU programs would probably not feel out of place if included in
>coreutils, e.g., grep, sed, time. They are probably separate since they
>were written by different people, even if the maintainers are mostly the
>same nowadays.

Indeed.

>> Anyway, hoping someone can answer my question even it is is technically
>> off-topic.
>>
>> This is an issue both for the man page and for the "info" page.
>>
>> It says that =WHEN is optional, which it is, but it doesn't say what
>> it defaults to. So, if you do --color, does that mean --color=never,
>> always, or auto ?

>Apologies for the lack of a link, but gnu.org is not responding at the
>moment. In the info docs the following text is under '--color':

FWIW, I checked "info grep" and could not find any mention of it.
The description of "--color" was identical to that found in the man
page.  Maybe my system is out of date.

>    WHEN is 'always' to use colors, 'never' to not use colors, or 'auto'
>    to use colors if standard output is associated with a terminal
>    device and the TERM environment variable's value suggests that the
>    terminal supports colors. Plain --color is treated like
>    --color=auto; if no --color option is given, the default is
>    --color=never.

>So '--color' is equivalent to '--color=auto'.

OK.  That makes sense.  It is what I would have guessed.

>I'll have a look at adding some text to the output of 'grep --help' like
>'ls --help' has for the same option. That will address the man page as
>well.

Thanks.

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

When responding to my posts, please try to refrain from giving bureaucratic 
answers.
If you have nothing useful to say, then just click Next and go on.

Reply via email to