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)