From 396c2edeb5e240f339cc51728a2ae1d83aded5e1 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 25 Jul 2023 17:21:54 +0200 Subject: Add option -P to just-install-cas ... to allow selecting a sub object of a specified tree. --- src/buildtool/common/cli.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/buildtool/common/cli.hpp') diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index 74ff0cce..a49b2f6b 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -119,6 +119,7 @@ struct RebuildArguments { struct FetchArguments { std::string object_id{}; std::optional output_path{}; + std::optional sub_path{}; bool remember{false}; bool raw_tree{}; }; @@ -518,6 +519,15 @@ static inline auto SetupFetchArguments( "Install path for the artifact. (omit to dump to stdout)") ->type_name("PATH"); + app->add_option_function( + "-P,--sub-object-path", + [clargs](auto const& rel_path) { + clargs->sub_path = ToNormalPath(rel_path).relative_path(); + }, + "Select the sub-object at the specified path (if artifact is a " + "tree).") + ->type_name("PATH"); + app->add_flag("--raw-tree", clargs->raw_tree, "Dump raw tree object (omit pretty printing)"); -- cgit v1.2.3