]> git.ipfire.org Git - dbl.git/commitdiff
dnsbl: Add --quiet/-q flag to be less verbose
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 6 Dec 2025 18:06:42 +0000 (18:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 6 Dec 2025 18:06:42 +0000 (18:06 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/dnsbl.in

index 4b767be90c3695ccb0638f59955104c2859a0825..8ecb6091c118662cef9c57ab3938df6fbb0ed3e4 100644 (file)
@@ -45,10 +45,16 @@ class CLI(object):
                subparsers = parser.add_subparsers()
 
                # Global Configuration Flags
-               parser.add_argument("--debug", action="store_true",     help=_("Enable debug output"))
                parser.add_argument("--config", default="@sysconfdir@/dnsbl.conf",
                                type=argparse.FileType("r"), help=_("Configuration File"))
 
+               # Logging Flags
+               logging_flags = parser.add_mutually_exclusive_group()
+               logging_flags.add_argument("--debug", action="store_true",
+                               help=_("Enable debug output"))
+               logging_flags.add_argument("--quiet", "-q", action="store_true",
+                               help=_("Be less verbose"))
+
                # Show Version
                parser.add_argument("--version", action="version", version="%(prog)s @VERSION@")
 
@@ -124,6 +130,8 @@ class CLI(object):
                # Configure logging
                if args.debug:
                        dnsbl.logger.set_level(logging.DEBUG)
+               elif args.quiet:
+                       dnsbl.logger.set_level(logging.ERROR)
 
                # Initialize the backend
                backend = dnsbl.Backend(