From 36920786ecae139217f8ea1eed4274e77477b2d0 Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Tue, 1 Sep 2020 17:02:41 -0400 Subject: SERVER-26338 Cherry-pick upstream SCons fix for abbreviated options issue See https://github.com/SCons/scons/commit/456428184f388eccccbcbc3d76866a8dce060b3c --- .../scons-local-3.1.2/SCons/Script/SConsOptions.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/third_party/scons-3.1.2') 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. """ -- cgit v1.2.1