diff options
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)"); |