diff options
author | Chris Johns <chrisj@rtems.org> | 2018-09-28 08:16:49 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2018-09-28 08:16:49 +1000 |
commit | d2d46786f113ed39d29deafa3feeb4d42ae94001 (patch) | |
tree | 8b27bfa9348aa16a8bf46904a0595e4aa1778a88 /source-builder | |
parent | sb: Add build sizes to the email report. (diff) | |
download | rtems-source-builder-d2d46786f113ed39d29deafa3feeb4d42ae94001.tar.bz2 |
sb: Include optional args in the valid option processing.
Optional arguments were not being included in the valid list of
options being checked so `--mail` resulted in being unknown.
Diffstat (limited to 'source-builder')
-rw-r--r-- | source-builder/sb/options.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source-builder/sb/options.py b/source-builder/sb/options.py index 24c2b4e..5767c48 100644 --- a/source-builder/sb/options.py +++ b/source-builder/sb/options.py @@ -237,12 +237,13 @@ class command_line: raise error.exit() def process(self): + for a in self.args: + if a == '-?' or a == '--help': + self.help() arg = 0 while arg < len(self.args): a = self.args[arg] - if a == '-?': - self.help() - elif a.startswith('--'): + if a.startswith('--'): los = a.split('=') lo = los[0] if lo in self._long_opts: @@ -266,8 +267,11 @@ class command_line: value = '1' self.defaults[los[0][2:].replace('-', '_').lower()] = ('none', 'none', value) else: - raise error.general('unknown option: %s' % (lo)) + if lo not in self.optargs: + raise error.general('unknown option: %s' % (lo)) else: + if a.startswith('-'): + raise error.general('not short options; only "-?"') self.opts['params'].append(a) arg += 1 |