diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-07-25 17:21:54 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-07-27 17:15:01 +0200 |
commit | 396c2edeb5e240f339cc51728a2ae1d83aded5e1 (patch) | |
tree | 434ff125a9f989a73243d69da741476a521c7b6a /src/buildtool/common/cli.hpp | |
parent | 26090ce503f40502a62d7ebabcb4ee060b28d05b (diff) | |
download | justbuild-396c2edeb5e240f339cc51728a2ae1d83aded5e1.tar.gz |
Add option -P to just-install-cas
... to allow selecting a sub object of a specified tree.
Diffstat (limited to 'src/buildtool/common/cli.hpp')
-rw-r--r-- | src/buildtool/common/cli.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
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<std::filesystem::path> output_path{}; + std::optional<std::filesystem::path> 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<std::string>( + "-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)"); |