From 77575870a0ce63abd8b87ff64080075a554daf93 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Mon, 9 May 2022 16:12:32 +0200 Subject: CLI: Fix use of multiple RE property options ... which were all ignored except the last. CLI11 usually only calls the option function once all options have been parsed. This change ensures that the option function is called everytime the option is parsed. --- src/buildtool/common/cli.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index afa6cffd..17ebd3f0 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -266,13 +266,14 @@ static inline auto SetupBuildArguments( throw CLI::ConversionError{property, "--remote-execution-property"}; } - clargs->platform_properties.emplace(std::move(key), - std::move(val)); + clargs->platform_properties[std::move(key)] = std::move(val); }, - "Property for remote execution as key-value pair.") + "Property for remote execution as key-value pair. Specifying this " + "option multiple times will accumulate pairs (latest wins).") ->type_name("KEY:VAL") ->allow_extra_args(false) - ->expected(1, 1); + ->expected(1, 1) + ->trigger_on_parse(true); // call this everytime the option is parsed app->add_option_function( "--action-timeout", -- cgit v1.2.3