pg.py: make `--version` a stand alone argument (for Python 3.3).
authorW. Trevor King <wking@tremily.us>
Wed, 10 Oct 2012 14:42:25 +0000 (10:42 -0400)
committerW. Trevor King <wking@tremily.us>
Wed, 10 Oct 2012 14:42:25 +0000 (10:42 -0400)
bin/pg.py

index a1ad271b67e6003aa1cac0021e53f296429e39e8..27f7888f4f3a14e4a195bb69c8fbd186c8ed46e6 100755 (executable)
--- a/bin/pg.py
+++ b/bin/pg.py
@@ -49,8 +49,10 @@ from pygrader.todo import print_todo as _todo
 if __name__ == '__main__':
     from argparse import ArgumentParser as _ArgumentParser
 
-    parser = _ArgumentParser(
-        description=__doc__, version=__version__)
+    parser = _ArgumentParser(description=__doc__)
+    parser.add_argument(
+        '-v', '--version', action='version',
+        version='%(prog)s {}'.format(_pgp_mime.__version__))
     parser.add_argument(
         '-d', '--base-dir', dest='basedir', default='.',
         help='Base directory containing grade data')