mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-23 02:16:01 +01:00
Support CLICOLOR(_FORCE) to control colored output
This commit is contained in:
parent
dfba301324
commit
6ce33c7e53
@ -108,6 +108,10 @@ class OptionsContext(Context.Context):
|
|||||||
jobs = self.jobs()
|
jobs = self.jobs()
|
||||||
p = self.add_option
|
p = self.add_option
|
||||||
color = os.environ.get('NOCOLOR', '') and 'no' or 'auto'
|
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('-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('-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)')
|
p('-k', '--keep', dest='keep', default=0, action='count', help='continue despite errors (-kk to try harder)')
|
||||||
|
Loading…
Reference in New Issue
Block a user