124,126c124,128
< AddOption('--colors', dest='use_colors', action='store_true')
< AddOption('--no-colors', dest='use_colors', action='store_false')
< use_colors = GetOption('use_colors')
---
> help_texts = {
> "options" : "",
> "global_vars" : "",
> "local_vars" : ""
> }
127a130,160
> Export("help_texts")
>
> def AddM5Option(*args, **kwargs):
> col_width = 30
>
> help = " " + ", ".join(args)
> if "help" in kwargs:
> length = len(help)
> if length >= col_width:
> help += "\n" + " " * col_width
> else:
> help += " " * (col_width - length)
> help += kwargs["help"]
> help_texts["options"] += help + "\n"
>
> AddOption(*args, **kwargs)
>
> AddM5Option('--colors', dest='use_colors', action='store_true',
> help="Add color to abbreviated scons output")
> AddM5Option('--no-colors', dest='use_colors', action='store_false',
> help="Don't add color to abbreviated scons output")
> AddM5Option('--default', dest='default', type='string', action='store',
> help='Override which build_opts file to use for defaults')
> AddM5Option('--ignore-style', dest='ignore_style', action='store_true',
> help='Disable style checking hooks')
> AddM5Option('--update-ref', dest='update_ref', action='store_true',
> help='Update test reference outputs')
> AddM5Option('--verbose', dest='verbose', action='store_true',
> help='Print full tool command lines')
>
> use_colors = GetOption('use_colors')
209c242
< if ARGUMENTS.get('IGNORE_STYLE') != 'True':
---
> if GetOption('ignore_style'):
321c354
< global_sticky_vars_file = joinpath(build_root, 'variables.global')
---
> global_vars_file = joinpath(build_root, 'variables.global')
323,324c356
< global_sticky_vars = Variables(global_sticky_vars_file, args=ARGUMENTS)
< global_nonsticky_vars = Variables(args=ARGUMENTS)
---
> global_vars = Variables(global_vars_file, args=ARGUMENTS)
326c358
< global_sticky_vars.AddVariables(
---
> global_vars.AddVariables(
336,339c368,370
< global_nonsticky_vars.AddVariables(
< ('VERBOSE', 'Print full tool command lines', False),
< ('update_ref', 'Update test reference outputs', False)
< )
---
> # Update main environment with values from ARGUMENTS & global_vars_file
> global_vars.Update(main)
> help_texts["global_vars"] += global_vars.GenerateHelpText(main)
341,358d371
< # Update main environment with values from ARGUMENTS & global_sticky_vars_file
< global_sticky_vars.Update(main)
< global_nonsticky_vars.Update(main)
< global_help_texts = {
< "global_sticky" : global_sticky_vars.GenerateHelpText(main),
< "global_nonsticky" : global_nonsticky_vars.GenerateHelpText(main)
< }
<
< # base help text
< help_text = '''
< Usage: scons [scons options] [build options] [target(s)]
<
< Global sticky options:
< %(global_sticky)s
< Global nonsticky options:
< %(global_nonsticky)s
< ''' % global_help_texts
<
360c373
< global_sticky_vars.Save(global_sticky_vars_file, main)
---
> global_vars.Save(global_vars_file, main)
458c471
< if main['VERBOSE']:
---
> if GetOption('verbose'):
968,969c981,984
< default_vars_file = joinpath('build_opts',
< ARGUMENTS.get('default', variant_dir))
---
> default = GetOption('default')
> if not default:
> default = variant_dir
> default_vars_file = joinpath('build_opts', default)
982c997,998
< help_text += "\nSticky variables for %s:\n" % variant_dir \
---
> help_texts["local_vars"] += \
> "Build variables for %s:\n" % variant_dir \
1027c1043,1054
< Help(help_text)
---
> # base help text
> Help('''
> Usage: scons [scons options] [build variables] [target(s)]
>
> Extra scons options:
> %(options)s
>
> Global build variables:
> %(global_vars)s
>
> %(local_vars)s
> ''' % help_texts)