Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1436813

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

From Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Newsgroups linux.kernel
Subject Re: checkkconfigsymbols.py: add --no-color option
Date 2016-07-05 09:30 +0200
Message-ID <rRsXU-87j-7@gated-at.bofh.it> (permalink)
References <rR7JM-3ot-29@gated-at.bofh.it> <rRbaG-5yi-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] checkkconfigsymbols.py: add --no-color option Andrew Donnellan <andrew.donnellan@au1.ibm.com> - 2016-07-04 10:50 +0200
  Re: [PATCH] checkkconfigsymbols.py: add --no-color option Valentin Rothberg <valentinrothberg@gmail.com> - 2016-07-04 12:50 +0200
  Re: checkkconfigsymbols.py: add --no-color option Josh Triplett <josh@joshtriplett.org> - 2016-07-04 14:30 +0200
    Re: checkkconfigsymbols.py: add --no-color option Andrew Donnellan <andrew.donnellan@au1.ibm.com> - 2016-07-05 09:30 +0200
  [PATCH v2] checkkconfigsymbols.py: add --no-color option, don't print color to non-TTY Andrew Donnellan <andrew.donnellan@au1.ibm.com> - 2016-07-05 09:50 +0200
    Re: [PATCH v2] checkkconfigsymbols.py: add --no-color option, don't  print color to non-TTY Valentin Rothberg <valentinrothberg@gmail.com> - 2016-07-05 10:50 +0200

csiph-web