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:

    volume-snapshot-create
                        Add a new snapshot.
    volume-snapshot-delete
                        Remove a snapshot.
    volume-snapshot-list
                        List all the snapshots.
    volume-snapshot-show
                        Show details about a snapshot.

example output after this patch:

    volume-snapshot-create      Add a new snapshot.
    volume-snapshot-delete      Remove a snapshot.
    volume-snapshot-list        List all the snapshots.
    volume-snapshot-show        Show details about a snapshot.

Change-Id: I517098748947e7bded03160a15e778bf79475d0d
Closes-Bug: #1326471
This commit is contained in:
Christian Berendt 2014-06-04 20:11:17 +02:00
parent 15ac2c9510
commit 8bef1e1110
1 changed files with 5 additions and 0 deletions

View File

@ -777,6 +777,11 @@ class OpenStackComputeShell(object):
# I'm picky about my shell help.
class OpenStackHelpFormatter(argparse.HelpFormatter):
def __init__(self, prog, indent_increment=2, max_help_position=32,
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:])