diff options
author | Sam James <sam@gentoo.org> | 2023-04-06 04:59:48 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2023-04-07 15:28:20 +0200 |
commit | 019180d848b162ebe3e815f0cfe7973fcec75251 (patch) | |
tree | 71503c58844c24634b117c699e66b4a6ceb897cc | |
parent | 55542cc5ac85b16d4f58c41e5bf9dec6c761c287 (diff) | |
download | gemato-019180d848b162ebe3e815f0cfe7973fcec75251.tar.gz |
cli: add --quiet for openpgp modes
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 <sam@gentoo.org>
Closes: https://github.com/projg2/gemato/pull/30
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r-- | gemato/cli.py | 4 |
1 files changed, 4 insertions, 0 deletions
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): """ |