Fix usage and alphabetical order

This commit is contained in:
Stephane Bortzmeyer 2021-07-07 11:04:04 +02:00
parent 86436ef1f0
commit 79032c1021

View File

@ -46,7 +46,7 @@ unixtime = False
# TODO implement timeout for HTTPS requests. -t option. Does Requests allow it?
def usage(msg=None):
print("Usage: %s -H domain-name [-c critical -w warning -u unixtime]" % sys.argv[0], end="")
print("Usage: %s -H domain-name [-c critical -w warning -u]" % sys.argv[0], end="")
if msg is not None and msg != "":
print(" (%s)" % msg)
else:
@ -81,8 +81,8 @@ def ok(msg=None):
sys.exit(STATE_OK)
try:
optlist, args = getopt.getopt (sys.argv[1:], "c:hH:vVw:u",
["critical=", "expiration", "help", "verbose", "version", "warning=", "unixtime"])
optlist, args = getopt.getopt (sys.argv[1:], "c:hH:uvVw:",
["critical=", "expiration", "help", "unixtime", "verbose", "version", "warning="])
for option, value in optlist:
if option == "--critical" or option == "-c":
critical_t = datetime.timedelta(days=int(value))