summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2012-11-12 16:25:58 -0500
committerMark McLoughlin <markmc@redhat.com>2012-11-15 15:01:14 -0500
commitdbc72a6ef9a784c1bf5820a9750061d76529d571 (patch)
tree0cbaeea6d24467667189c09b69ed90d66d245814
parent768a147ac5e993df3eda3558542a3fe81b8a3d11 (diff)
Use stock argparse behaviour for optional args
optparse would print "Options" but argparse prints "optional arguments". The default argparse behaviour is fine, let's stick with that. Change-Id: Ib53a2581af9d776e9a7c1cd90eebe89b70034e57
-rw-r--r--openstack/common/cfg.py1
-rw-r--r--tests/unit/test_cfg.py4
2 files changed, 2 insertions, 3 deletions
diff --git a/openstack/common/cfg.py b/openstack/common/cfg.py
index f4757bc..7939d02 100644
--- a/openstack/common/cfg.py
+++ b/openstack/common/cfg.py
@@ -932,7 +932,6 @@ class ConfigCliParser(argparse.ArgumentParser):
*args, **kwargs)
self.add_argument('--version', action='version', version=version)
- self._optionals.title = 'Options'
def add_argument(self, *args, **kwargs):
try:
diff --git a/tests/unit/test_cfg.py b/tests/unit/test_cfg.py
index 84ab73e..4289c7d 100644
--- a/tests/unit/test_cfg.py
+++ b/tests/unit/test_cfg.py
@@ -123,7 +123,7 @@ class UsageTestCase(BaseTestCase):
self.conf([])
self.conf.print_usage(file=f)
self.assertTrue('usage: test FOO BAR' in f.getvalue())
- self.assertTrue('Options:' not in f.getvalue())
+ self.assertTrue('optional:' not in f.getvalue())
class HelpTestCase(BaseTestCase):
@@ -133,7 +133,7 @@ class HelpTestCase(BaseTestCase):
self.conf([])
self.conf.print_help(file=f)
self.assertTrue('usage: test FOO BAR' in f.getvalue())
- self.assertTrue('Options:' in f.getvalue())
+ self.assertTrue('optional' in f.getvalue())
self.assertTrue('-h, --help' in f.getvalue())