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
This commit is contained in:
Christian Berendt
2014-06-04 21:15:17 +02:00
parent 68a6424256
commit 12d484160c

View File

@@ -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:])