align command list with options

This commit is contained in:
Georgi Valkov 2012-12-07 12:25:03 +02:00
parent 715c7eff71
commit 2559c784bb
1 changed files with 3 additions and 2 deletions

View File

@ -14,8 +14,9 @@ class PrettyHelpFormatter(optparse.IndentedHelpFormatter):
"""A prettier/less verbose help formatter for optparse."""
def __init__(self, *args, **kwargs):
kwargs['max_help_position'] = 30
kwargs['indent_increment'] = 1
# help position must be aligned with __init__.parseopts.description
kwargs['max_help_position'] = 23
kwargs['indent_increment'] = 2
kwargs['width'] = get_terminal_size()[0] - 2
optparse.IndentedHelpFormatter.__init__(self, *args, **kwargs)