Mercurial > hg > stampit
comparison stampit/main.py @ 2:164af2a4d291
better description formatting
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 19 Apr 2010 15:17:08 -0700 |
parents | 820beace15f2 |
children | 6ef0e769248d |
comparison
equal
deleted
inserted
replaced
1:820beace15f2 | 2:164af2a4d291 |
---|---|
9 mozmill-1.4.1-linux.tar.gz | 9 mozmill-1.4.1-linux.tar.gz |
10 """ | 10 """ |
11 | 11 |
12 import sys | 12 import sys |
13 | 13 |
14 from optparse import OptionParser | 14 from optparse import OptionParser, IndentedHelpFormatter, HelpFormatter |
15 from subprocess import call | 15 from subprocess import call |
16 | 16 |
17 class UnformattedDescription(IndentedHelpFormatter): | |
18 def format_description(self, description): | |
19 return description.strip() or '' | |
17 | 20 |
18 def main(args=sys.argv[1:]): | 21 def main(args=sys.argv[1:]): |
19 usage = '%prog [options] <package> <platform>' | 22 usage = '%prog [options] <package> <platform>' |
20 parser = OptionParser(usage, description=globals()['__doc__']) | 23 parser = OptionParser(usage, description=globals()['__doc__'], |
24 formatter=UnformattedDescription()) | |
21 parser.add_option('--version', | 25 parser.add_option('--version', |
22 help='version of the package to be installed (defaults to the current on the cheeseshop)') | 26 help='version of the package to be installed (defaults to the current on the cheeseshop)') |
23 options, args = parser.parse_args(args) | 27 options, args = parser.parse_args(args) |
24 | 28 |
25 if not args: | 29 if not args: |