From 9b9f410d6b08c52ae56563c5970e1d7a5023014c Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 25 Apr 2025 10:04:19 +0200 Subject: just: make --dump-artifacts act cummulatively --- src/buildtool/common/cli.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/buildtool/common/cli.hpp') diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index 26b284d9..51cf3ef3 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -114,7 +114,7 @@ struct BuildArguments { std::optional> local_launcher{std::nullopt}; std::chrono::milliseconds timeout{kDefaultTimeout}; std::size_t build_jobs{}; - std::optional dump_artifacts{std::nullopt}; + std::vector dump_artifacts{}; std::optional print_to_stdout{std::nullopt}; bool print_unique{false}; bool show_runfiles{false}; @@ -535,10 +535,14 @@ static inline auto SetupExtendedBuildArguments( gsl::not_null const& app, gsl::not_null const& clargs) { - app->add_option("--dump-artifacts", - clargs->dump_artifacts, - "Dump artifacts to file (use - for stdout).") - ->type_name("PATH"); + app->add_option_function( + "--dump-artifacts", + [clargs](auto const& file_) { + clargs->dump_artifacts.emplace_back(file_); + }, + "Dump artifacts to file (use - for stdout).") + ->type_name("PATH") + ->trigger_on_parse(); app->add_flag("-s,--show-runfiles", clargs->show_runfiles, -- cgit v1.2.3