summaryrefslogtreecommitdiff
path: root/src/buildtool/common/cli.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-01-08 18:05:48 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-01-09 13:59:16 +0100
commit3c2877dd63698f6ef424538ed91ffa66144bf115 (patch)
tree60b9a40c708ff3e870dc915e01a974d1cbf78b91 /src/buildtool/common/cli.hpp
parent16d3b50a4f8d8f3de21297759467f47b6ff374f9 (diff)
downloadjustbuild-3c2877dd63698f6ef424538ed91ffa66144bf115.tar.gz
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.
Diffstat (limited to 'src/buildtool/common/cli.hpp')
-rw-r--r--src/buildtool/common/cli.hpp5
1 files changed, 5 insertions, 0 deletions
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<std::string> dump_artifacts{std::nullopt};
std::optional<std::string> 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<CLI::App*> const& app,