From 5987b71c808aafad504ef3f3cc77c6557acd91fe Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 11 Apr 2021 15:09:11 +0200 Subject: [PATCH] Improved configuration to allow multiple arguments --- src/cpl/configuration/configuration.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cpl/configuration/configuration.py b/src/cpl/configuration/configuration.py index 2f4bdf42..72959a94 100644 --- a/src/cpl/configuration/configuration.py +++ b/src/cpl/configuration/configuration.py @@ -85,7 +85,7 @@ class Configuration(ConfigurationABC): Console.write_line(f'[{name}] {message}') Console.set_foreground_color(ForegroundColorEnum.default) - def _set_variable(self, name: str, value: str): + def _set_variable(self, name: str, value: any): """ Sets variable to given value :param name: @@ -295,9 +295,12 @@ class Configuration(ConfigurationABC): exit() + add_args = [] for next_arg in next_arguments: if next_arg not in self._handled_args and next_arg not in self._additional_arguments: - self._additional_arguments.append(next_arg) + add_args.append(next_arg) + + self._set_variable(f'{argument}AdditionalArguments', add_args) def add_json_file(self, name: str, optional: bool = None, output: bool = True, path: str = None): if os.path.isabs(name):