aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2016-04-27 16:24:00 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-06 10:30:56 +0100
commit408694f4320f3cb52a391e5b927fb8c8ba16c1d2 (patch)
treed5966112840f790d79b80aa33028cd424a2b6484
parent7fdaaedf4c63c8d019f03f84e22f9b838ef19aa6 (diff)
downloadopenembedded-core-contrib-408694f4320f3cb52a391e5b927fb8c8ba16c1d2.tar.gz
scripts/lib/argparse_oe: simplify options title change
There's no need to iterate over the action groups here, as self._optionals and self._positionals are available. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/argparse_oe.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/scripts/lib/argparse_oe.py b/scripts/lib/argparse_oe.py
index 75002d02af..2185a66cd8 100644
--- a/scripts/lib/argparse_oe.py
+++ b/scripts/lib/argparse_oe.py
@@ -14,6 +14,7 @@ class ArgumentParser(argparse.ArgumentParser):
kwargs.setdefault('formatter_class', OeHelpFormatter)
self._subparser_groups = OrderedDict()
super(ArgumentParser, self).__init__(*args, **kwargs)
+ self._optionals.title = 'options'
def error(self, message):
"""error(message: string)
@@ -93,10 +94,6 @@ class ArgumentSubParser(ArgumentParser):
if 'order' in kwargs:
self._order = kwargs.pop('order')
super(ArgumentSubParser, self).__init__(*args, **kwargs)
- for agroup in self._action_groups:
- if agroup.title == 'optional arguments':
- agroup.title = 'options'
- break
def parse_known_args(self, args=None, namespace=None):
# This works around argparse not handling optional positional arguments being