mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 12:04:27 +01:00
cli_function: config args are given
This commit is contained in:
@@ -162,6 +162,7 @@ class CliFunction:
|
|||||||
Resolve default arguments from the config file and CLI param defaults.
|
Resolve default arguments from the config file and CLI param defaults.
|
||||||
|
|
||||||
Add an extra _args_given argument which determines if an argument was given or not.
|
Add an extra _args_given argument which determines if an argument was given or not.
|
||||||
|
Args set from the config file count as given.
|
||||||
'''
|
'''
|
||||||
args_with_defaults = kwargs.copy()
|
args_with_defaults = kwargs.copy()
|
||||||
# Add missing args from config file.
|
# Add missing args from config file.
|
||||||
@@ -189,6 +190,7 @@ class CliFunction:
|
|||||||
raise Exception('Unknown key in config file: ' + key)
|
raise Exception('Unknown key in config file: ' + key)
|
||||||
if not args_given[key]:
|
if not args_given[key]:
|
||||||
args_with_defaults[key] = config_configs[key]
|
args_with_defaults[key] = config_configs[key]
|
||||||
|
args_given[key] = True
|
||||||
# Add missing args from hard-coded defaults.
|
# Add missing args from hard-coded defaults.
|
||||||
for key in self._arguments:
|
for key in self._arguments:
|
||||||
argument = self._arguments[key]
|
argument = self._arguments[key]
|
||||||
|
|||||||
Reference in New Issue
Block a user