All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Borowski <kilobyte@angband.pl>
To: Joe Perches <joe@perches.com>
Cc: John Brooks <john@fastquake.com>,
	Andy Whitcroft <apw@canonical.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: Change format of --color argument to --color[=WHEN]
Date: Tue, 6 Jun 2017 07:48:31 +0200	[thread overview]
Message-ID: <20170606054831.4avyamnkdns6nmyy@angband.pl> (raw)
In-Reply-To: <1496704230.1968.5.camel@perches.com>

On Mon, Jun 05, 2017 at 04:10:30PM -0700, Joe Perches wrote:
> On Mon, 2017-06-05 at 18:27 -0400, John Brooks wrote:
> > The boolean --color argument did not offer the ability to force colourized
> > output even if stdout is not a terminal.
> 
> OK, but why is colorizing output not to terminals desired?

* You may post-process the output somehow.  grep, sed, some highlighter...
* The output may go to less -R, ansi2html, etc.

I've made a tool that does what you want, "pipetty" (Debian package
colorized-logs, in stretch and jessie-backports), but that's a dirty hack. 
Lying about isatty() works for programs that check STDOUT but it's notorious
to instead look at STDIN, which can't be fooled in a reliable way.  Thus,
it's better to standardize on --color={always,auto,never}.


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀ A tit a day keeps the vet away.
⣾⠁⢰⠒⠀⣿⡁
⢿⡄⠘⠷⠚⠋⠀ (Rejoice as my small-animal-murder-machine got unbroken after
⠈⠳⣄⠀⠀⠀⠀ nearly two years of no catch!)

  parent reply	other threads:[~2017-06-06  5:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05 22:27 [PATCH] checkpatch: Change format of --color argument to --color[=WHEN] John Brooks
2017-06-05 23:10 ` Joe Perches
2017-06-05 23:28   ` John Brooks
2017-06-06  5:48   ` Adam Borowski [this message]
2017-06-06 17:07   ` [PATCH v2] " John Brooks
2017-06-06 19:21     ` Joe Perches
2017-06-06 19:56       ` John Brooks
2017-06-06 20:03         ` Joe Perches
2017-06-07  1:50           ` [PATCH V3] " Joe Perches
2017-06-07 13:41             ` John Brooks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170606054831.4avyamnkdns6nmyy@angband.pl \
    --to=kilobyte@angband.pl \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=john@fastquake.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.