From 20d105a65d305c724948ce389654c74cacac013c Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 8 Mar 2024 10:21:46 +0100 Subject: gc: add option --no-rotation ... to clean up what can be done without losing cache information. --- src/buildtool/common/cli.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/buildtool/common/cli.hpp') diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index 387092bc..5b8df960 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -180,6 +180,10 @@ struct ServeArguments { std::vector repositories{}; }; +struct GcArguments { + bool no_rotate{}; +}; + static inline auto SetupCommonArguments( gsl::not_null const& app, gsl::not_null const& clargs) { @@ -723,4 +727,12 @@ static inline void SetupRetryArguments( "the resources that survived the outage. (Default: 60)"); } +static inline void SetupGcArguments(gsl::not_null const& app, + gsl::not_null const& args) { + app->add_flag("--no-rotate", + args->no_rotate, + "Do not rotate cache generations, only clean up what can be " + "done without losing cache."); +} + #endif // INCLUDED_SRC_BUILDTOOL_COMMON_CLI_HPP -- cgit v1.2.3