From 4fdae6705916ab457d76d0913d33808d8e22a681 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 24 Jun 2019 13:51:35 +0300 Subject: [PATCH] json: Fix minor things and update the README --- README.md | 5 +++-- kconfig-hardened-check.py | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c69a5e7..e73ebff 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ Please don't cry if my Python code looks like C. I'm just a kernel developer. ### Usage ``` -#usage: kconfig-hardened-check.py [-h] [-p {X86_64,X86_32,ARM64,ARM}] - [-c CONFIG] [--debug] +usage: kconfig-hardened-check.py [-h] [-p {X86_64,X86_32,ARM64,ARM}] + [-c CONFIG] [--debug] [--json] Checks the hardening options in the Linux kernel config @@ -40,6 +40,7 @@ optional arguments: -c CONFIG, --config CONFIG check the config_file against these preferences --debug enable internal debug mode + --json print results in JSON format ``` diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index d11d9e7..fa24526 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -451,13 +451,12 @@ def check_config_file(fname): if debug_mode: known_options = [opt.name for opt in checklist] for option, value in parsed_options.items(): - if option not in known_options and not json_mode: + if option not in known_options: print("DEBUG: dunno about option {} ({})".format(option, value)) print_checks() - if __name__ == '__main__': parser = ArgumentParser(description='Checks the hardening options in the Linux kernel config') parser.add_argument('-p', '--print', choices=supported_archs, @@ -467,7 +466,7 @@ if __name__ == '__main__': parser.add_argument('--debug', action='store_true', help='enable internal debug mode') parser.add_argument('--json', action='store_true', - help='print results in json format') + help='print results in JSON format') args = parser.parse_args() if args.debug: -- 2.31.1