From 89752a45512a103c863411da58656d9e2910068d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 10 Oct 2012 10:42:25 -0400 Subject: [PATCH] pg.py: make `--version` a stand alone argument (for Python 3.3). --- bin/pg.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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') -- 2.26.2