summaryrefslogtreecommitdiff
path: root/troveclient/shell.py
diff options
context:
space:
mode:
authorSushil Kumar <sushil.kumar2@globallogic.com>2013-12-12 14:07:01 +0000
committerSushil Kumar <sushil.kumar2@globallogic.com>2013-12-12 14:25:27 +0000
commit2c509b7fa1e6018d240583c3656d461a3222b53d (patch)
treecf92dd3cbb1860ccb5e55804c71f1d2dbde157b9 /troveclient/shell.py
parente728b04379a536c819c4836833970705d51c77bc (diff)
downloadpython-troveclient-2c509b7fa1e6018d240583c3656d461a3222b53d.tar.gz
Fixes trove help command
Reason: - trove help output misplaces the position of "<subcommand> ..." from bottom to top. - This behavior is because of formatting done to Print positionals before optionals. Changes: - Sequence fixed in trove help output. Change-Id: I8aff2eec9f915a7ec1960b67ee7ba8423624aad6 Closes-Bug: #1260332
Diffstat (limited to 'troveclient/shell.py')
-rw-r--r--troveclient/shell.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/troveclient/shell.py b/troveclient/shell.py
index 8cbf5d4..aba5218 100644
--- a/troveclient/shell.py
+++ b/troveclient/shell.py
@@ -614,8 +614,15 @@ class OpenStackHelpFormatter(argparse.HelpFormatter):
if len(prefix) + len(prog) <= 0.75 * text_width:
indent = ' ' * (len(prefix) + len(prog) + 1)
if pos_parts:
- lines = get_lines([prog] + pos_parts, indent, prefix)
- lines.extend(get_lines(opt_parts, indent))
+ if prog == 'trove':
+ # "trove help" called without any subcommand
+ lines = get_lines([prog] + opt_parts, indent,
+ prefix)
+ lines.extend(get_lines(pos_parts, indent))
+ else:
+ lines = get_lines([prog] + pos_parts, indent,
+ prefix)
+ lines.extend(get_lines(opt_parts, indent))
elif opt_parts:
lines = get_lines([prog] + opt_parts, indent, prefix)
else: