From: W. Trevor King Date: Wed, 10 Oct 2012 12:47:09 +0000 (-0400) Subject: send-pgp-mime: make `--version` a stand alone argument (for Python 3.3). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d4f92c07b3b34cfbc9bc83f376d15b21ca91f15d;p=pgp-mime.git send-pgp-mime: make `--version` a stand alone argument (for Python 3.3). --- diff --git a/bin/send-pgp-mime.py b/bin/send-pgp-mime.py index 01f063a..64cde69 100755 --- a/bin/send-pgp-mime.py +++ b/bin/send-pgp-mime.py @@ -92,8 +92,10 @@ if __name__ == '__main__': parser = argparse.ArgumentParser( description = doc_lines[0], epilog = '\n'.join(doc_lines[1:]).strip(), - version=_pgp_mime.__version__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument( + '-v', '--version', action='version', + version='%(prog)s {}'.format(_pgp_mime.__version__)) parser.add_argument( '-e', '--encoding', metavar='ENCODING', default='utf-8', help='encoding for input files')