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:
parent
1d01ada2aa
commit
f791ede668
4
chkip.py
4
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")
|
parser.add_argument("--me", action="store_true", help="Zeigt lokale & öffentliche IPs und prüft auf CGNAT")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if not args.me and not args.domain:
|
||||||
|
print(parser.format_usage().strip())
|
||||||
|
return
|
||||||
|
|
||||||
if args.me:
|
if args.me:
|
||||||
local_v4, public_v4, public_v6 = get_my_ip()
|
local_v4, public_v4, public_v6 = get_my_ip()
|
||||||
result = {
|
result = {
|
||||||
|
Loading…
Reference in New Issue
Block a user