From 320ab961d8804f2d495796049485827f882edf7b Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Wed, 12 Jul 2023 11:11:27 +0300 Subject: [PATCH] Show error if some cmdline option exists multiple times --- kconfig_hardened_check/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index a423358..572ed0a 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -193,6 +193,8 @@ def parse_cmdline_file(parsed_options, fname): else: name = opt value = '' # '' is not None + if name in parsed_options: + sys.exit(f'[!] ERROR: cmdline option "{name}" exists multiple times') value = normalize_cmdline_options(name, value) parsed_options[name] = value -- 2.31.1