summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2020-09-01 17:02:41 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-09 21:02:28 +0000
commit3885be271487bf1849a1cd5da1215795a3e21477 (patch)
tree0320b3aceb5cbe2ac1a94d4bda137922e84ca29e
parentcc8e51c57669e792ac025660428dbfd6a29e09dd (diff)
downloadmongo-3885be271487bf1849a1cd5da1215795a3e21477.tar.gz
SERVER-23668 Cherry-pick upstream SCons fix for abbreviated options issue
See https://github.com/SCons/scons/commit/456428184f388eccccbcbc3d76866a8dce060b3c (cherry picked from commit 36920786ecae139217f8ea1eed4274e77477b2d0) (cherry picked from commit 59c563338ae7dc6106aff81071a3bfd7b7f0389c)
-rw-r--r--src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConsOptions.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConsOptions.py b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConsOptions.py
index e7a3fc1800f..8b25cc43266 100644
--- a/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConsOptions.py
+++ b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConsOptions.py
@@ -269,8 +269,7 @@ class SConsOptionParser(optparse.OptionParser):
"""
arg = rargs.pop(0)
- # Value explicitly attached to arg? Pretend it's the next
- # argument.
+ # Value explicitly attached to arg? Pretend it's the next argument.
if "=" in arg:
(opt, next_arg) = arg.split("=", 1)
rargs.insert(0, next_arg)
@@ -280,7 +279,11 @@ class SConsOptionParser(optparse.OptionParser):
had_explicit_value = False
try:
- opt = self._match_long_opt(opt)
+ if opt != self._match_long_opt(opt):
+ raise optparse.BadOptionError(
+ "'%s'. Did you mean '%s'?"
+ % (opt, self._match_long_opt(opt))
+ )
except optparse.BadOptionError:
if self.preserve_unknown_options:
# SCons-specific: if requested, add unknown options to
@@ -396,7 +399,7 @@ class SConsOptionParser(optparse.OptionParser):
"""
Adds a local option to the parser.
- This is initiated by a SetOption() call to add a user-defined
+ This is initiated by an AddOption() 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.
"""