From: Alexander Popov Date: Sun, 13 Aug 2023 16:49:08 +0000 (+0300) Subject: Report that --print and --generate can't be used together X-Git-Tag: v0.6.6~103 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=bd3b0638e8c18cd629bd8c639d273d0e98d36cd2;p=kconfig-hardened-check.git Report that --print and --generate can't be used together --- diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 7b4993f..0502785 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -348,6 +348,8 @@ def main(): if args.print: assert(args.config is None and args.cmdline is None and args.sysctl is None), 'unexpected args' + if args.generate: + sys.exit('[!] ERROR: --print and --generate can\'t be used together') if mode and mode not in ('verbose', 'json'): sys.exit(f'[!] ERROR: wrong mode "{mode}" for --print') arch = args.print @@ -360,7 +362,7 @@ def main(): sys.exit(0) if args.generate: - assert(args.config is None and args.cmdline is None and args.sysctl is None), 'unexpected args' + assert(args.config is None and args.cmdline is None and args.sysctl is None and args.print is None), 'unexpected args' if mode: sys.exit(f'[!] ERROR: wrong mode "{mode}" for --generate') arch = args.generate