On 06/17/2015 09:04 PM, Paul J. Lucas wrote:
> On Jun 17, 2015, at 12:52 PM, Eric Blake <ebl...@redhat.com> wrote:
> 
>> But you don't always want color when piping.
> 
> I know.  I was asking specifically about what grep does (or should do) only 
> when the user supplies —color=auto.
> 
>> No, we want --color=auto to be tied SPECIFICALLY to a tty…
> 
> Because…?

Historical precedence and consistency among all GNU apps that support
--color=auto.  And because:

alias grep='grep --color=auto'
grep | grep

should NOT colorize the first grep's output, even though it is going
into a pipe to the second grep.  When you WANT color as a non-default
(or to disable color when outputting to a tty), then you can temporarily
override your alias:

grep --color=always | grep

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to