summaryrefslogtreecommitdiff
path: root/src/buildtool/common/cli.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-04-25 10:04:19 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-04-25 13:11:59 +0200
commit9b9f410d6b08c52ae56563c5970e1d7a5023014c (patch)
tree3a53c6da956a5bfcdb03c7facf3a5ecfad7e7f45 /src/buildtool/common/cli.hpp
parentca9b1fa2328cfa7f511c30191146147f0726a1a5 (diff)
downloadjustbuild-9b9f410d6b08c52ae56563c5970e1d7a5023014c.tar.gz
just: make --dump-artifacts act cummulatively
Diffstat (limited to 'src/buildtool/common/cli.hpp')
-rw-r--r--src/buildtool/common/cli.hpp14
1 files changed, 9 insertions, 5 deletions
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<std::vector<std::string>> local_launcher{std::nullopt};
std::chrono::milliseconds timeout{kDefaultTimeout};
std::size_t build_jobs{};
- std::optional<std::string> dump_artifacts{std::nullopt};
+ std::vector<std::filesystem::path> dump_artifacts{};
std::optional<std::string> print_to_stdout{std::nullopt};
bool print_unique{false};
bool show_runfiles{false};
@@ -535,10 +535,14 @@ static inline auto SetupExtendedBuildArguments(
gsl::not_null<CLI::App*> const& app,
gsl::not_null<BuildArguments*> const& clargs) {
- app->add_option("--dump-artifacts",
- clargs->dump_artifacts,
- "Dump artifacts to file (use - for stdout).")
- ->type_name("PATH");
+ app->add_option_function<std::string>(
+ "--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,