mirror of https://github.com/pypa/pip
cli help formatting fixes
This commit is contained in:
parent
b5af67469f
commit
f00b015d73
|
@ -64,10 +64,16 @@ class PrettyHelpFormatter(optparse.IndentedHelpFormatter):
|
|||
# leave full control over description to us
|
||||
if description:
|
||||
if hasattr(self.parser, 'main'):
|
||||
label = 'Commands:'
|
||||
label = 'Commands'
|
||||
else:
|
||||
label = 'Description:'
|
||||
description = label + ' %s\n' % self.indent_lines(textwrap.dedent(description), " ")
|
||||
label = 'Description'
|
||||
#some doc strings have inital newlines, some don't
|
||||
description = description.lstrip('\n')
|
||||
#some doc strings have final newlines and spaces, some don't
|
||||
description = description.rstrip()
|
||||
#dedent, then reindent
|
||||
description = self.indent_lines(textwrap.dedent(description), " ")
|
||||
description = '%s:\n%s\n' % (label, description)
|
||||
return description
|
||||
else:
|
||||
return ''
|
||||
|
|
Loading…
Reference in New Issue