[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <8ab63bee-b025-427d-b4db-b71e729aa36d@au1.ibm.com>
Date: Tue, 5 Jul 2016 17:22:05 +1000
From: Andrew Donnellan <andrew.donnellan@....ibm.com>
To: Josh Triplett <josh@...htriplett.org>
Cc: linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
valentinrothberg@...il.com
Subject: Re: checkkconfigsymbols.py: add --no-color option
On 04/07/16 22:24, Josh Triplett wrote:
> Rather than requiring an explicit option, how about detecting
> whether stdout is a TTY and automatically suppressing color?
> You could check "os.isatty(1)" in main(), and set a global "color =
> False". That would automatically handle the cases of redirecting to a
> file or piping to another script, without requiring the user to pass
> --no-color.
That's a good point - I'll submit a v2 with that.
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@....ibm.com IBM Australia Limited
Powered by blists - more mailing lists