# HG changeset patch # User Jeff Hammel # Date 1271715428 25200 # Node ID 164af2a4d2919b842292ecd27338890aed7430e8 # Parent 820beace15f2a336b92dd92d35bdd304754aa6c7 better description formatting diff -r 820beace15f2 -r 164af2a4d291 stampit/main.py --- a/stampit/main.py Mon Apr 19 14:54:47 2010 -0700 +++ b/stampit/main.py Mon Apr 19 15:17:08 2010 -0700 @@ -11,13 +11,17 @@ import sys -from optparse import OptionParser +from optparse import OptionParser, IndentedHelpFormatter, HelpFormatter from subprocess import call +class UnformattedDescription(IndentedHelpFormatter): + def format_description(self, description): + return description.strip() or '' def main(args=sys.argv[1:]): usage = '%prog [options] ' - parser = OptionParser(usage, description=globals()['__doc__']) + parser = OptionParser(usage, description=globals()['__doc__'], + formatter=UnformattedDescription()) parser.add_option('--version', help='version of the package to be installed (defaults to the current on the cheeseshop)') options, args = parser.parse_args(args)