]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
Add quiet mode
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 15 May 2020 11:01:38 +0000 (11:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 15 May 2020 11:01:38 +0000 (11:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location-downloader.in
src/python/location-exporter.in
src/python/location-importer.in
src/python/location-query.in

index f1d38f1418a87c803d78ee18beea13932aef5fae..ce3c85d7d43eb159367becd646007a50235fef68 100644 (file)
@@ -219,6 +219,8 @@ class CLI(object):
                # Global configuration flags
                parser.add_argument("--debug", action="store_true",
                        help=_("Enable debug output"))
+               parser.add_argument("--quiet", action="store_true",
+                       help=_("Enable quiet mode"))
 
                # version
                parser.add_argument("--version", action="version",
@@ -245,9 +247,11 @@ class CLI(object):
 
                args = parser.parse_args()
 
-               # Enable debug logging
+               # Configure logging
                if args.debug:
                        location.logger.set_level(logging.DEBUG)
+               elif args.quiet:
+                       location.logger.set_level(logging.WARNING)
 
                # Print usage if no action was given
                if not "func" in args:
index 634b8625ba82feee8d3088bf0f82c07dc250912f..894bb4408272c03aca3ab3cba5ad4387bbd6e0d0 100644 (file)
@@ -197,6 +197,8 @@ class CLI(object):
                # Global configuration flags
                parser.add_argument("--debug", action="store_true",
                        help=_("Enable debug output"))
+               parser.add_argument("--quiet", action="store_true",
+                       help=_("Enable quiet mode"))
 
                # version
                parser.add_argument("--version", action="version",
@@ -222,9 +224,11 @@ class CLI(object):
 
                args = parser.parse_args()
 
-               # Enable debug logging
+               # Configure logging
                if args.debug:
                        location.logger.set_level(logging.DEBUG)
+               elif args.quiet:
+                       location.logger.set_level(logging.WARNING)
 
                return args
 
index 45cacad81c58db8b0aeed25cac7333092c54049e..2ba4eb21e4f30fb299436037114e64575783732a 100644 (file)
@@ -45,6 +45,8 @@ class CLI(object):
                # Global configuration flags
                parser.add_argument("--debug", action="store_true",
                        help=_("Enable debug output"))
+               parser.add_argument("--quiet", action="store_true",
+                       help=_("Enable quiet mode"))
 
                # version
                parser.add_argument("--version", action="version",
@@ -91,9 +93,11 @@ class CLI(object):
 
                args = parser.parse_args()
 
-               # Enable debug logging
+               # Configure logging
                if args.debug:
                        location.logger.set_level(logging.DEBUG)
+               elif args.quiet:
+                       location.logger.set_level(logging.WARNING)
 
                # Print usage if no action was given
                if not "func" in args:
index 85d1cbf82ac41414d3d624cc0fd209f816df0ff8..c138644cd1c35a8acd206233b53741716bea7056 100644 (file)
@@ -121,6 +121,8 @@ class CLI(object):
                # Global configuration flags
                parser.add_argument("--debug", action="store_true",
                        help=_("Enable debug output"))
+               parser.add_argument("--quiet", action="store_true",
+                       help=_("Enable quiet mode"))
 
                # version
                parser.add_argument("--version", action="version",
@@ -204,9 +206,11 @@ class CLI(object):
 
                args = parser.parse_args()
 
-               # Enable debug logging
+               # Configure logging
                if args.debug:
                        location.logger.set_level(logging.DEBUG)
+               elif args.quiet:
+                       location.logger.set_level(logging.WARNING)
 
                # Print usage if no action was given
                if not "func" in args: