ensure that there is a newline between usage and options

This commit is contained in:
Georgi Valkov 2012-12-10 00:02:27 +02:00
parent 1976a65d47
commit 841ae62768
1 changed files with 3 additions and 5 deletions

View File

@ -53,12 +53,10 @@ class PrettyHelpFormatter(optparse.IndentedHelpFormatter):
def format_usage(self, usage):
"""
ensure there is only one newline between usage and the first heading
if there is no description
Ensure there is only one newline between usage and the first heading
if there is no description.
"""
msg = 'Usage: %s' % usage
if self.parser.description:
msg += '\n'
msg = 'Usage: %s\n' % usage
return msg
def format_description(self, description):