From e4bbf59415e610fc090572aff29cd20cdb9c41f8 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Mon, 13 Jun 2022 13:30:13 +0200 Subject: RemoteExecutionConfig: Keep global platform properties ... and cache endpoint address for rebuilding. --- src/buildtool/common/cli.hpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/buildtool/common/cli.hpp') diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index ab4a7ff1..adfa3445 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -62,7 +62,7 @@ struct EndpointArguments { /// \brief Arguments required for building. struct BuildArguments { std::optional> local_launcher{std::nullopt}; - std::map platform_properties; + std::vector platform_properties; std::chrono::milliseconds timeout{kDefaultTimeout}; std::size_t build_jobs{}; std::optional dump_artifacts{std::nullopt}; @@ -262,25 +262,14 @@ static inline auto SetupBuildArguments( ->type_name("JSON") ->default_val(nlohmann::json{"env", "--"}.dump()); - app->add_option_function( + app->add_option( "--remote-execution-property", - [clargs](auto const& property) { - std::istringstream pss(property); - std::string key; - std::string val; - if (not std::getline(pss, key, ':') or - not std::getline(pss, val, ':')) { - throw CLI::ConversionError{property, - "--remote-execution-property"}; - } - clargs->platform_properties[std::move(key)] = std::move(val); - }, + clargs->platform_properties, "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) - ->trigger_on_parse(true); // call this everytime the option is parsed + ->expected(1, 1); app->add_option_function( "--action-timeout", -- cgit v1.2.3