From f4ded187800527324ab244979342e288f6cfa8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 22 Jan 2019 00:00:00 +0000 Subject: [PATCH] cli_function: config args are given --- cli_function.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli_function.py b/cli_function.py index 6d91f60..911eee9 100755 --- a/cli_function.py +++ b/cli_function.py @@ -162,6 +162,7 @@ class CliFunction: 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. + Args set from the config file count as given. ''' args_with_defaults = kwargs.copy() # Add missing args from config file. @@ -189,6 +190,7 @@ class CliFunction: raise Exception('Unknown key in config file: ' + key) if not args_given[key]: args_with_defaults[key] = config_configs[key] + args_given[key] = True # Add missing args from hard-coded defaults. for key in self._arguments: argument = self._arguments[key]