Show error if some cmdline option exists multiple times
authorAlexander Popov <alex.popov@linux.com>
Wed, 12 Jul 2023 08:11:27 +0000 (11:11 +0300)
committerAlexander Popov <alex.popov@linux.com>
Wed, 12 Jul 2023 08:11:27 +0000 (11:11 +0300)
kconfig_hardened_check/__init__.py

index a423358b932d8dd3cb82a6e5c9c64259d856e3b7..572ed0ab6f7467e42bfa50256b0fe9d8cd4f4889 100644 (file)
@@ -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