Add --hostname option
This commit adds a --hostname option that is mutually exclusive to -H/--host-address. The idea is to make check_xmppng compatible with check_v46. Thanks to Andreas Krause for the inspiration.
This commit is contained in:
parent
c7cce10d8e
commit
55ff04ba21
1 changed files with 5 additions and 2 deletions
|
@ -508,8 +508,11 @@ def main():
|
||||||
"""
|
"""
|
||||||
import argparse
|
import argparse
|
||||||
parser = argparse.ArgumentParser(description="Check XMPP services")
|
parser = argparse.ArgumentParser(description="Check XMPP services")
|
||||||
parser.add_argument(
|
host_address = parser.add_mutually_exclusive_group(required=True)
|
||||||
"-H", "--host-address", help="host address", required=True)
|
host_address.add_argument("-H", "--host-address", help="host address")
|
||||||
|
host_address.add_argument(
|
||||||
|
"--hostname", help="host name, alternative for host-address",
|
||||||
|
dest="host_address")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-p", "--port", help="port", type=int)
|
"-p", "--port", help="port", type=int)
|
||||||
is_server = parser.add_mutually_exclusive_group()
|
is_server = parser.add_mutually_exclusive_group()
|
||||||
|
|
Loading…
Reference in a new issue