New version: 0.1.1 includes new user and zone command

Also allows list without zone for listing all records in all zones
pull/11/head
Micke Nordin 1 month ago
parent 1cdb6472fa
commit 9bdaa81aca

@ -413,7 +413,7 @@ def get_parser() -> dict:
listcmd.add_argument("-d", "--data") listcmd.add_argument("-d", "--data")
listcmd.add_argument("-n", "--name") listcmd.add_argument("-n", "--name")
listcmd.add_argument("-r", "--rtype") listcmd.add_argument("-r", "--rtype")
listcmd.add_argument("-z", "--zone", required=True) listcmd.add_argument("-z", "--zone", required=False)
user_description = "View user information." user_description = "View user information."
usercmd = subparsers.add_parser("user", description=user_description) usercmd = subparsers.add_parser("user", description=user_description)
@ -452,9 +452,8 @@ def get_parser() -> dict:
updatecmd.add_argument("-t", "--ttl") updatecmd.add_argument("-t", "--ttl")
updatecmd.add_argument("-z", "--zone", required=True) updatecmd.add_argument("-z", "--zone", required=True)
zone_description = "View zone information." zone_description = "View zones."
zonecmd = subparsers.add_parser("zone", description=zone_description) subparsers.add_parser("zone", description=zone_description)
zonecmd.add_argument("-z", "--zone", default=None)
argcomplete.autocomplete(parser) argcomplete.autocomplete(parser)
@ -500,8 +499,6 @@ def run(url, args, headers, baseurl, parser, username):
run_log(url, args.json, headers) run_log(url, args.json, headers)
elif args.command == "zone": elif args.command == "zone":
url = baseurl + "/zones" url = baseurl + "/zones"
if args.zone:
url = url + f"/{args.zone.rstrip('.')}"
run_zone(url, args.json, headers) run_zone(url, args.json, headers)
else: else:
parser.print_help(sys.stderr) parser.print_help(sys.stderr)

Loading…
Cancel
Save