summaryrefslogtreecommitdiffstats
path: root/acmens.py
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-05-02 22:13:07 -0400
committersiddharth <s@ricketyspace.net>2021-05-02 22:13:07 -0400
commitae508704925754cd6d325f7181fc759f5d4606d4 (patch)
tree1cbb721b7f479a44f48ac43b6fa1377890be9f87 /acmens.py
parent35bac7092628a200d28576f52e33c7dade5db14d (diff)
acmens.py: add --version switch
Shows `acmens` version.
Diffstat (limited to 'acmens.py')
-rw-r--r--acmens.py8
1 files changed, 7 insertions, 1 deletions
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)