Messages in this thread | | | Subject | Re: checkkconfigsymbols.py: add --no-color option | From | Andrew Donnellan <> | Date | Tue, 5 Jul 2016 17:22:05 +1000 |
| |
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@au1.ibm.com IBM Australia Limited
| |