From: W. Trevor King Date: Wed, 10 Oct 2012 14:42:25 +0000 (-0400) Subject: pg.py: make `--version` a stand alone argument (for Python 3.3). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=89752a45512a103c863411da58656d9e2910068d;p=pygrader.git pg.py: make `--version` a stand alone argument (for Python 3.3). --- diff --git a/bin/pg.py b/bin/pg.py index a1ad271..27f7888 100755 --- 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')