diff options
author | Tom Tanner <ttanner2@bloomberg.net> | 2013-09-30 14:18:50 (GMT) |
---|---|---|
committer | Tom Tanner <ttanner2@bloomberg.net> | 2013-09-30 14:18:50 (GMT) |
commit | 01f45ca84f2b1c9f2b8113e09a270503ab8581e0 (patch) | |
tree | eca285f352e4cf9dd648be40d3599175fdd48e7b | |
parent | 43f296c7c2a350de0c59a442e566c165420803e3 (diff) | |
download | SCons-01f45ca84f2b1c9f2b8113e09a270503ab8581e0.zip SCons-01f45ca84f2b1c9f2b8113e09a270503ab8581e0.tar.gz SCons-01f45ca84f2b1c9f2b8113e09a270503ab8581e0.tar.bz2 |
Allow multiple options with --debug
-rw-r--r-- | src/engine/SCons/Script/SConsOptions.py | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index 645ab11..c1f389a 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -248,7 +248,7 @@ class SConsOption(optparse.Option): class SConsOptionGroup(optparse.OptionGroup): """ A subclass for SCons-specific option groups. - + The only difference between this and the base class is that we print the group's help text flush left, underneath their own title but lined up with the normal "SCons Options". @@ -340,7 +340,7 @@ class SConsOptionParser(optparse.OptionParser): def add_local_option(self, *args, **kw): """ Adds a local option to the parser. - + This is initiated by a SetOption() call to add a user-defined command-line option. We add the option to a separate option group for the local options, creating the group if necessary. @@ -394,11 +394,11 @@ class SConsIndentedHelpFormatter(optparse.IndentedHelpFormatter): out liking: -- add our own regular expression that doesn't break on hyphens - (so things like --no-print-directory don't get broken); + (so things like --no-print-directory don't get broken); -- wrap the list of options themselves when it's too long (the wrapper.fill(opts) call below); - + -- set the subsequent_indent when wrapping the help_text. """ # The help for each option consists of two parts: @@ -606,23 +606,25 @@ def Parser(version): "pdb", "prepare", "presub", "stacktrace", "time"] - def opt_debug(option, opt, value, parser, + def opt_debug(option, opt, value__, parser, debug_options=debug_options, deprecated_debug_options=deprecated_debug_options): - if value in debug_options: - parser.values.debug.append(value) - elif value in deprecated_debug_options.keys(): - parser.values.debug.append(value) - try: - parser.values.delayed_warnings - except AttributeError: - parser.values.delayed_warnings = [] - msg = deprecated_debug_options[value] - w = "The --debug=%s option is deprecated%s." % (value, msg) - t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w) - parser.values.delayed_warnings.append(t) - else: - raise OptionValueError(opt_invalid('debug', value, debug_options)) + for value in value__.split(','): + if value in debug_options: + parser.values.debug.append(value) + elif value in deprecated_debug_options.keys(): + parser.values.debug.append(value) + try: + parser.values.delayed_warnings + except AttributeError: + parser.values.delayed_warnings = [] + msg = deprecated_debug_options[value] + w = "The --debug=%s option is deprecated%s." % (value, msg) + t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w) + parser.values.delayed_warnings.append(t) + else: + raise OptionValueError(opt_invalid('debug', value, debug_options)) + opt_debug_help = "Print various types of debugging information: %s." \ % ", ".join(debug_options) op.add_option('--debug', |