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.
This commit is contained in:
Pascal Bouquet 2025-04-19 17:32:20 +02:00
parent 1d01ada2aa
commit f791ede668

View File

@ -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 = {