From 6ce33c7e53a5d3800117a699f49c52fd5ea25f41 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Fri, 17 Mar 2017 13:21:12 +0100 Subject: [PATCH] Support CLICOLOR(_FORCE) to control colored output --- waflib/Options.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/waflib/Options.py b/waflib/Options.py index 06ab61cf..09290b15 100644 --- a/waflib/Options.py +++ b/waflib/Options.py @@ -108,6 +108,10 @@ class OptionsContext(Context.Context): jobs = self.jobs() p = self.add_option color = os.environ.get('NOCOLOR', '') and 'no' or 'auto' + if os.environ.get('CLICOLOR', '') == '0': + color = 'no' + elif os.environ.get('CLICOLOR_FORCE', '') == '1': + color = 'yes' p('-c', '--color', dest='colors', default=color, action='store', help='whether to use colors (yes/no/auto) [default: auto]', choices=('yes', 'no', 'auto')) p('-j', '--jobs', dest='jobs', default=jobs, type='int', help='amount of parallel jobs (%r)' % jobs) p('-k', '--keep', dest='keep', default=0, action='count', help='continue despite errors (-kk to try harder)')