Re: checkkconfigsymbols.py: add --no-color option

From: Andrew Donnellan
Date: Tue Jul 05 2016 - 03:22:15 EST


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@xxxxxxxxxxx IBM Australia Limited