From 3c2877dd63698f6ef424538ed91ffa66144bf115 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 8 Jan 2025 18:05:48 +0100 Subject: just build: add new option -p ... allowing to print the unique artifact built (if any). This allows convenient inspection of the build result of targets that define precisely one artifact. --- src/buildtool/common/cli.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/buildtool/common/cli.hpp') diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index 3c7ac45e..c6771cb3 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -114,6 +114,7 @@ struct BuildArguments { std::size_t build_jobs{}; std::optional dump_artifacts{std::nullopt}; std::optional print_to_stdout{std::nullopt}; + bool print_unique{false}; bool show_runfiles{false}; }; @@ -533,6 +534,10 @@ static inline auto SetupExtendedBuildArguments( clargs->print_to_stdout, "After building, print the specified artifact to stdout.") ->type_name("LOGICAL_PATH"); + + app->add_flag("-p,--print-unique-artifact", + clargs->print_unique, + "Print the unique artifact, if any, to stdout."); } static inline auto SetupTCArguments(gsl::not_null const& app, -- cgit v1.2.3