From ae508704925754cd6d325f7181fc759f5d4606d4 Mon Sep 17 00:00:00 2001 From: siddharth Date: Sun, 2 May 2021 22:13:07 -0400 Subject: acmens.py: add --version switch Shows `acmens` version. --- acmens.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/acmens.py b/acmens.py index 3d6e0be..bf1e14f 100644 --- a/acmens.py +++ b/acmens.py @@ -512,6 +512,7 @@ $ acmens --revoke --account-key user.key --crt domain.crt -------------- """, ) + parser.add_argument("--version", action="store_true", help="Show version and exit") parser.add_argument( "--revoke", action="store_true", help="Revoke a signed certificate" ) @@ -521,7 +522,6 @@ $ acmens --revoke --account-key user.key --crt domain.crt parser.add_argument( "-k", "--account-key", - required=True, help="path to your Let's Encrypt account private key", ) parser.add_argument( @@ -540,6 +540,12 @@ $ acmens --revoke --account-key user.key --crt domain.crt parser.add_argument("--crt", help="path to your signed certificate") args = parser.parse_args() + if args.version: + print("acmens v{}".format(__version__)) + sys.exit(0) + if args.account_key is None: + sys.stderr.write("Error: Path account key is required\n") + sys.exit(1) if (not args.revoke) and (args.csr is None): sys.stderr.write("Error: Path to CSR required\n") sys.exit(1) -- cgit v1.2.3