From 019180d848b162ebe3e815f0cfe7973fcec75251 Mon Sep 17 00:00:00 2001 From: Sam James Date: Thu, 6 Apr 2023 04:59:48 +0100 Subject: cli: add --quiet for openpgp modes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit emerge-webrsync needs this to suppress non-error/warning messages when running in quiet mode to avoid noise in cronjobs. Signed-off-by: Sam James Closes: https://github.com/projg2/gemato/pull/30 Signed-off-by: Michał Górny --- gemato/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gemato/cli.py b/gemato/cli.py index b85d9c4..0047a5d 100644 --- a/gemato/cli.py +++ b/gemato/cli.py @@ -61,6 +61,8 @@ class GematoCommand: """ subp.add_argument('--debug', action='store_true', help='Enable debugging output') + subp.add_argument('-q', '--quiet', action='store_true', + help='Only emit warning or error messages') def parse_args(self, args, argp): """ @@ -69,6 +71,8 @@ class GematoCommand: """ if args.debug: logging.getLogger().setLevel(logging.DEBUG) + elif args.quiet: + logging.getLogger().setLevel(logging.WARNING) def __call__(self): """ -- cgit v1.2.3