mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Do not accept an extra separate option for --with/--without.
The --with/--without that does not have an extra option was consuming an extra option on the command line.
This commit is contained in:
parent
a83fc54f09
commit
ba0008c372
@ -427,7 +427,7 @@ class command_line:
|
|||||||
def params(self):
|
def params(self):
|
||||||
return self.opts['params']
|
return self.opts['params']
|
||||||
|
|
||||||
def parse_args(self, arg, error = True):
|
def parse_args(self, arg, error = True, extra = True):
|
||||||
for a in range(0, len(self.args)):
|
for a in range(0, len(self.args)):
|
||||||
if self.args[a].startswith(arg):
|
if self.args[a].startswith(arg):
|
||||||
lhs = None
|
lhs = None
|
||||||
@ -439,12 +439,11 @@ class command_line:
|
|||||||
rhs = '='.join(eqs[1:])
|
rhs = '='.join(eqs[1:])
|
||||||
else:
|
else:
|
||||||
rhs = eqs[1]
|
rhs = eqs[1]
|
||||||
else:
|
elif extra:
|
||||||
lhs = self.args[a]
|
lhs = self.args[a]
|
||||||
a += 1
|
a += 1
|
||||||
if a >= len(self.args):
|
if a < len(self.args):
|
||||||
return [arg, None]
|
rhs = self.args[a]
|
||||||
rhs = self.args[a]
|
|
||||||
return [lhs, rhs]
|
return [lhs, rhs]
|
||||||
a += 1
|
a += 1
|
||||||
return None
|
return None
|
||||||
@ -458,7 +457,7 @@ class command_line:
|
|||||||
for pre in ['with', 'without']:
|
for pre in ['with', 'without']:
|
||||||
arg_str = '--%s-%s' % (pre, label)
|
arg_str = '--%s-%s' % (pre, label)
|
||||||
arg_label = '%s_%s' % (pre, label)
|
arg_label = '%s_%s' % (pre, label)
|
||||||
arg = self.parse_args(arg_str, error = False)
|
arg = self.parse_args(arg_str, error = False, extra = False)
|
||||||
if arg is not None:
|
if arg is not None:
|
||||||
if arg[1] is None:
|
if arg[1] is None:
|
||||||
result = 'yes'
|
result = 'yes'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user