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-02 03:35:23 +0000
commit36920786ecae139217f8ea1eed4274e77477b2d0 (patch)
treebdb7c2b79ec0316b10f2cd1b00bd733874467910
parentf825465df95a1e663f65c149b2fe6412778372eb (diff)
downloadmongo-36920786ecae139217f8ea1eed4274e77477b2d0.tar.gz
SERVER-26338 Cherry-pick upstream SCons fix for abbreviated options issue
See https://github.com/SCons/scons/commit/456428184f388eccccbcbc3d76866a8dce060b3c
-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.
"""