2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-25 19:30:04 +01:00

command-line options override environment variables, and not the other way around

This commit is contained in:
Thomas Nagy 2014-01-06 15:00:45 +01:00
parent 0cc696faa3
commit 12b1212f4d
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
3 changed files with 4 additions and 3 deletions

View File

@ -7,6 +7,8 @@ NEW IN WAF 1.8.0
* LaTeX multibib #1345
* Various improvements in the Python detection and processing
* Rst document processing
* Console handling improvements
* Properly-sized progress bar on windows
NEW IN WAF 1.7.11
-----------------

View File

@ -40,8 +40,6 @@ colors_lst = {
def enable_colors(use):
if use == 1:
if os.environ.get('NOCOLOR', ''):
use = 0
if not (sys.stderr.isatty() or sys.stdout.isatty()):
use = 0
if Utils.is_win32:

View File

@ -51,7 +51,8 @@ class opt_parser(optparse.OptionParser):
self.ctx = ctx
jobs = ctx.jobs()
p('-c', '--color', dest='colors', default='auto', action='store', help='whether to use colors (yes/no/auto) [default: auto]', choices=('yes', 'no', 'auto'))
color = os.environ.get('NOCOLOR', '') and 'no' or '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('-k', '--keep', dest='keep', default=0, action='count', help='keep running happily even if errors are found')
p('-v', '--verbose', dest='verbose', default=0, action='count', help='verbosity level -v -vv or -vvv [default: 0]')