From f791ede66841242b95b9339162e7ccaaca9dcbc4 Mon Sep 17 00:00:00 2001 From: Pascal Bouquet Date: Sat, 19 Apr 2025 17:32:20 +0200 Subject: [PATCH] Show usage line when no arguments and no --me flag are provided Previously, running chkip without any arguments attempted to resolve None as a domain, resulting in misleading output like "No A record". This commit adds a check to print the usage line if neither a domain nor the --me flag is specified. This improves usability and makes the tool behave more predictably when called without arguments. --- chkip.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chkip.py b/chkip.py index 58e78e3..0d79a73 100644 --- a/chkip.py +++ b/chkip.py @@ -216,6 +216,10 @@ def main(): parser.add_argument("--me", action="store_true", help="Zeigt lokale & öffentliche IPs und prüft auf CGNAT") args = parser.parse_args() + if not args.me and not args.domain: + print(parser.format_usage().strip()) + return + if args.me: local_v4, public_v4, public_v6 = get_my_ip() result = {