From: Michael Tremer Date: Mon, 8 Dec 2025 17:00:24 +0000 (+0000) Subject: dnsbl: Allow to specify an output file for single exports X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d58e9ceda1df4046823ac638f3b5607b2a708fa;p=dbl.git dnsbl: Allow to specify an output file for single exports Signed-off-by: Michael Tremer --- diff --git a/src/scripts/dnsbl.in b/src/scripts/dnsbl.in index 2911be2..b3e9188 100644 --- a/src/scripts/dnsbl.in +++ b/src/scripts/dnsbl.in @@ -98,6 +98,8 @@ class CLI(object): # export export = subparsers.add_parser("export", help=_("Exports a list")) export.add_argument("list", help=_("The name of the list")) + export.add_argument("output", type=argparse.FileType("w"), + help=_("The output file")) export.add_argument("--format", default="domains", choices=("domains", "hosts", "rpz",), help=_("Output Format")) export.set_defaults(func=self.__export) @@ -280,7 +282,7 @@ class CLI(object): list = backend.lists.get_by_slug(args.list) # Export! - list.export(sys.stdout, format=args.format) + list.export(args.output, format=args.format) def __export_all(self, backend, args): """