From 9bdaa81aca5cc25b78b12b667eee7bdd5203ccb2 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sat, 21 Dec 2024 15:51:35 +0100 Subject: [PATCH] New version: 0.1.1 includes new user and zone command Also allows list without zone for listing all records in all zones --- knotctl/__init__.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/knotctl/__init__.py b/knotctl/__init__.py index 4ab4779..9b1451f 100755 --- a/knotctl/__init__.py +++ b/knotctl/__init__.py @@ -413,7 +413,7 @@ def get_parser() -> dict: listcmd.add_argument("-d", "--data") listcmd.add_argument("-n", "--name") listcmd.add_argument("-r", "--rtype") - listcmd.add_argument("-z", "--zone", required=True) + listcmd.add_argument("-z", "--zone", required=False) user_description = "View user information." usercmd = subparsers.add_parser("user", description=user_description) @@ -452,9 +452,8 @@ def get_parser() -> dict: updatecmd.add_argument("-t", "--ttl") updatecmd.add_argument("-z", "--zone", required=True) - zone_description = "View zone information." - zonecmd = subparsers.add_parser("zone", description=zone_description) - zonecmd.add_argument("-z", "--zone", default=None) + zone_description = "View zones." + subparsers.add_parser("zone", description=zone_description) argcomplete.autocomplete(parser) @@ -500,8 +499,6 @@ def run(url, args, headers, baseurl, parser, username): run_log(url, args.json, headers) elif args.command == "zone": url = baseurl + "/zones" - if args.zone: - url = url + f"/{args.zone.rstrip('.')}" run_zone(url, args.json, headers) else: parser.print_help(sys.stderr)