From bd3b0638e8c18cd629bd8c639d273d0e98d36cd2 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 13 Aug 2023 19:49:08 +0300 Subject: [PATCH] Report that --print and --generate can't be used together --- kconfig_hardened_check/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.31.1