diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-06-21 07:55:31 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-06-21 07:55:31 +0200 |
commit | 39fa0bace059116d9a45e09fcd18691390b166bd (patch) | |
tree | 77f5abf2964bd92dc9e338654a4ffaaffc24d9ce /src/engine/SCons/Script/SConsOptions.py | |
parent | f9b0c331d8b9d03be91b56e324f59424af45302b (diff) | |
parent | f7e5d2b46b03cc4bc09c38f7e0873378bb9c3b78 (diff) |
Merge tag 'upstream/2.3.5'
Upstream version 2.3.5
Diffstat (limited to 'src/engine/SCons/Script/SConsOptions.py')
-rw-r--r-- | src/engine/SCons/Script/SConsOptions.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index 4e8fd3f..35688e1 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2001 - 2014 The SCons Foundation +# Copyright (c) 2001 - 2015 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/SConsOptions.py 2014/09/27 12:51:43 garyo" +__revision__ = "src/engine/SCons/Script/SConsOptions.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog" import optparse import re @@ -319,7 +319,13 @@ class SConsOptionParser(optparse.OptionParser): value = option.const elif len(rargs) < nargs: if nargs == 1: - self.error(_("%s option requires an argument") % opt) + if not option.choices: + self.error(_("%s option requires an argument") % opt) + else: + msg = _("%s option requires an argument " % opt) + msg += _("(choose from %s)" + % ', '.join(option.choices)) + self.error(msg) else: self.error(_("%s option requires %d arguments") % (opt, nargs)) @@ -645,18 +651,12 @@ def Parser(version): config_options = ["auto", "force" ,"cache"] - def opt_config(option, opt, value, parser, c_options=config_options): - if not value in c_options: - raise OptionValueError(opt_invalid('config', value, c_options)) - setattr(parser.values, option.dest, value) - opt_config_help = "Controls Configure subsystem: %s." \ % ", ".join(config_options) op.add_option('--config', - nargs=1, type="string", + nargs=1, choices=config_options, dest="config", default="auto", - action="callback", callback=opt_config, help = opt_config_help, metavar="MODE") |