From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264AbdFFFsi (ORCPT ); Tue, 6 Jun 2017 01:48:38 -0400 Received: from tartarus.angband.pl ([89.206.35.136]:42215 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbdFFFsh (ORCPT ); Tue, 6 Jun 2017 01:48:37 -0400 Date: Tue, 6 Jun 2017 07:48:31 +0200 From: Adam Borowski To: Joe Perches Cc: John Brooks , Andy Whitcroft , linux-kernel@vger.kernel.org Subject: Re: [PATCH] checkpatch: Change format of --color argument to --color[=WHEN] Message-ID: <20170606054831.4avyamnkdns6nmyy@angband.pl> References: <1496701622-1465-1-git-send-email-john@fastquake.com> <1496704230.1968.5.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1496704230.1968.5.camel@perches.com> X-Junkbait: aaron@angband.pl, zzyx@angband.pl User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kilobyte@angband.pl X-SA-Exim-Scanned: No (on tartarus.angband.pl); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!)