diff -r d61cd2e5889a -r 9d047a9c76b5 SConstruct --- a/SConstruct Thu Mar 03 02:40:29 2011 -0800 +++ b/SConstruct Thu Mar 03 02:43:16 2011 -0800 @@ -152,6 +152,8 @@ 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('--print-build-vars', dest='print_build_vars', action='store_true', + help='Print information about the build variables') AddM5Option('--update-ref', dest='update_ref', action='store_true', help='Update test reference outputs') AddM5Option('--verbose', dest='verbose', action='store_true', @@ -1040,15 +1042,24 @@ variant_dir = joinpath(variant_path, 'tests', e.Label), exports = { 'env' : e }, duplicate = False) -# base help text -Help(''' +basic_help = ''' Usage: scons [scons options] [build variables] [target(s)] Extra scons options: %(options)s +''' % help_texts +build_var_help = ''' Global build variables: %(global_vars)s %(local_vars)s -''' % help_texts) +''' % help_texts + +if GetOption('print_build_vars'): + # Force the 'help' option so scons will print the build variables and + # exit. + SetOption('help', True) + Help(build_var_help) +else: + Help(basic_help)