send-pgp-mime: make `--version` a stand alone argument (for Python 3.3).
authorW. Trevor King <wking@tremily.us>
Wed, 10 Oct 2012 12:47:09 +0000 (08:47 -0400)
committerW. Trevor King <wking@tremily.us>
Wed, 10 Oct 2012 12:47:09 +0000 (08:47 -0400)
bin/send-pgp-mime.py

index 01f063a07a6764e86f825b811e8712c364f2e34f..64cde6930570175e375b1ae6f2fd503d4099ef82 100755 (executable)
@@ -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')