From 6f26619042e9b134710f9e10feec26e2bd887f36 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Sun, 22 Jan 2023 11:32:48 +0100 Subject: cli: Add --no-require-all-good to openpgp-verify command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- gemato/cli.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gemato/cli.py b/gemato/cli.py index 6ecf017..da0487a 100644 --- a/gemato/cli.py +++ b/gemato/cli.py @@ -1,5 +1,5 @@ # gemato: CLI routines -# (c) 2017-2022 Michał Górny +# (c) 2017-2023 Michał Górny # Licensed under the terms of 2-clause BSD license @@ -543,6 +543,12 @@ class OpenPGPVerifyCommand(VerifyingOpenPGPMixin, GematoCommand): def add_options(self, subp): super().add_options(subp) + subp.add_argument( + "--no-require-all-good", + dest="require_all_good", + action="store_false", + default=True, + help="Require only one good signature on multi-signature files") subp.add_argument( 'paths', nargs='*', default=['-'], help='Paths to hash (defaults to "-" (stdin) if not ' @@ -552,6 +558,7 @@ class OpenPGPVerifyCommand(VerifyingOpenPGPMixin, GematoCommand): super().parse_args(args, argp) self.paths = args.paths + self.require_all_good = args.require_all_good def __call__(self): super().__call__() @@ -566,7 +573,8 @@ class OpenPGPVerifyCommand(VerifyingOpenPGPMixin, GematoCommand): try: try: - sig = self.openpgp_env.verify_file(f) + sig = self.openpgp_env.verify_file( + f, require_all_good=self.require_all_good) except GematoException as e: logging.error( f'OpenPGP verification failed for {p}:\n{e}') -- cgit v1.2.3