## Usage
```
usage: kconfig-hardened-check [-h] [-p {X86_64,X86_32,ARM64,ARM}] [-c CONFIG]
- [--debug] [--json]
+ [--debug] [--json] [--version]
Checks the hardening options in the Linux kernel config
check the config_file against these preferences
--debug enable verbose debug mode
--json print results in JSON format
+ --version show program's version number and exit
```
## Output for `Ubuntu 18.04 (Bionic Beaver with HWE)` kernel config
So the version of `kconfig-hardened-check` is associated with the corresponding version of the kernel.
-The version format is: __[major_number].[kernel_version]__
-
-The current version of `kconfig-hardened-check` is __0.5.5__, it's marked with the git tag.
+The version format is: __[major_number].[kernel_version].[kernel_patchlevel]__
## Questions and answers
--- /dev/null
+__version__ = '0.5.5'
from collections import OrderedDict
import re
import json
+from .__about__ import __version__
# debug_mode enables:
# - reporting about unknown kernel options in the config,
config_checklist = []
- parser = ArgumentParser(description='Checks the hardening options in the Linux kernel config')
+ parser = ArgumentParser(prog='kconfig-hardened-check',
+ description='Checks the hardening options in the Linux kernel config')
parser.add_argument('-p', '--print', choices=supported_archs,
help='print hardening preferences for selected architecture')
parser.add_argument('-c', '--config',
help='enable verbose debug mode')
parser.add_argument('--json', action='store_true',
help='print results in JSON format')
+ parser.add_argument('--version', action='version', version='%(prog)s ' + __version__)
args = parser.parse_args()
if args.debug:
[metadata]
name = kconfig-hardened-check
-version = 0.5.5
author = Alexander Popov
author_email = alex.popov@linux.com
home-page = https://github.com/a13xp0p0v/kconfig-hardened-check
from setuptools import setup
-setup()
+about = {}
+with open("kconfig_hardened_check/__about__.py") as f:
+ exec(f.read(), about)
+
+print('v: "{}"'.format(about['__version__']))
+
+# See the options in setup.cfg
+setup(version = about['__version__'])