GNU bug report logs - #20062
[PATCH] diff: add support for --color

Previous Next

Package: diffutils;

Reported by: Giuseppe Scrivano <gscrivan <at> redhat.com>

Date: Sun, 8 Mar 2015 21:57:02 UTC

Severity: normal

Tags: patch

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Giuseppe Scrivano <gscrivan <at> redhat.com>, 20062 <at> debbugs.gnu.org
Subject: bug#20062: [bug-diffutils] bug#20062: [PATCH] diff: add support for --color
Date: Mon, 09 Mar 2015 08:50:59 -0600
[Message part 1 (text/plain, inline)]
On 03/08/2015 03:56 PM, Giuseppe Scrivano wrote:
> * doc/diffutils.texi (diff Options): Add documentation for --color.
> Copied from coreutils ls --color.

Cool!

> +@item --color [=@var{when}]
> +@cindex color, distinguishing file types with
> +Specify whether to use color for distinguishing file types.  @var{when}
> +may be omitted, or one of:
> +@itemize @bullet
> +@item none
> +@vindex none @r{color option}
> +- Do not use color at all.  This is the default.

At first, I was worried that this meant that '--color' ==
'--color=none'; so maybe you want this to read "This is the default when
no --color option is present"

> +@item auto
> +@vindex auto @r{color option}
> +@cindex terminal, using color iff
> +- Only use color if standard output is a terminal.
> +@item always
> +@vindex always @r{color option}
> +- Always use color.
> +@end itemize
> +Specifying @option{--color} and no @var{when} is equivalent to
> +@option{--color=always}.

Is this the right default?  Some GNU programs default --color to
--color=auto; others to --color=always.  I'm 50:50 on which default is
better, but it's worth thinking about rather than just blindly picking
one, as we have both GNU styles as precedent.

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

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 8 years and 79 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.