mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +01:00
Improve custom option processing #2280
This commit is contained in:
parent
93a0258996
commit
4f8099fbdc
@ -62,6 +62,21 @@ class opt_parser(optparse.OptionParser):
|
||||
else:
|
||||
self.error(str(e))
|
||||
|
||||
def _process_long_opt(self, rargs, values):
|
||||
# --custom-option=-ftxyz is interpreted as -f -t... see #2280
|
||||
if self.allow_unknown:
|
||||
back = [] + rargs
|
||||
try:
|
||||
optparse.OptionParser._process_long_opt(self, rargs, values)
|
||||
except optparse.BadOptionError:
|
||||
while rargs:
|
||||
rargs.pop()
|
||||
rargs.extend(back)
|
||||
rargs.pop(0)
|
||||
raise
|
||||
else:
|
||||
optparse.OptionParser._process_long_opt(self, rargs, values)
|
||||
|
||||
def print_usage(self, file=None):
|
||||
return self.print_help(file)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user