From 12d484160c3b3367bd2cfc6eeb5f6ec7669252a6 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 4 Jun 2014 21:15:17 +0200 Subject: Overwrite HelpFormatter constructur to extend argument column Overwrite the HelpFormatter constructor in the class OpenStackHelpFormatter to modify the default value of the max_help_position to extend the width of the argument column in the help output. example output before this patch: configuration-attach Attaches a configuration group to an instance. configuration-create Creates a configuration group. configuration-default Shows the default configuration of an instance. configuration-delete Deletes a configuration group. configuration-detach Detaches a configuration group from an instance. example output after this patch: configuration-attach Attaches a configuration group to an instance. configuration-create Creates a configuration group. configuration-default Shows the default configuration of an instance. configuration-delete Deletes a configuration group. configuration-detach Detaches a configuration group from an instance. Change-Id: Ia3ad8e9fefca6da40f55ab3de902c015a0d17006 Closes-Bug: #1326471 --- troveclient/shell.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/troveclient/shell.py b/troveclient/shell.py index 46bbf2d..7e21817 100644 --- a/troveclient/shell.py +++ b/troveclient/shell.py @@ -501,6 +501,11 @@ class OpenStackTroveShell(object): # I'm picky about my shell help. class OpenStackHelpFormatter(argparse.HelpFormatter): + def __init__(self, prog, indent_increment=2, max_help_position=34, + width=None): + super(OpenStackHelpFormatter, self).__init__(prog, indent_increment, + max_help_position, width) + def start_section(self, heading): # Title-case the headings heading = '%s%s' % (heading[0].upper(), heading[1:]) -- cgit v1.2.1