comparison document_it.py @ 13:1efb669ab1c8

better description formatting
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 02 Aug 2011 16:36:08 -0700
parents 54e27f046cd2
children 145a11393a73
comparison
equal deleted inserted replaced
12:54e27f046cd2 13:1efb669ab1c8
84 84
85 # description formatter 85 # description formatter
86 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): 86 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter):
87 def format_description(self, description): 87 def format_description(self, description):
88 if description: 88 if description:
89 return description + '\n' 89 return description.strip() + '\n'
90 else: 90 else:
91 return '' 91 return ''
92 92
93 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) 93 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
94 parser.add_option('-d', '--directory', dest='directory', 94 parser.add_option('-d', '--directory', dest='directory',