changeset 1:820beace15f2

get description from module docstring
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 19 Apr 2010 14:54:47 -0700
parents af10f7e072ed
children 164af2a4d291
files stampit/main.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stampit/main.py	Mon Apr 19 17:41:06 2010 -0400
+++ b/stampit/main.py	Mon Apr 19 14:54:47 2010 -0700
@@ -17,11 +17,15 @@
 
 def main(args=sys.argv[1:]):
     usage = '%prog [options] <package> <platform>'
-    parser = OptionParser(usage)
+    parser = OptionParser(usage, description=globals()['__doc__'])
     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)
 
+    if not args:
+        parser.print_help()
+        sys.exit(0)
+
     # create a virtualenv
 #    call(['virtualenv'])