summaryrefslogtreecommitdiff
path: root/src/buildtool/common/cli.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-08 10:21:46 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-11 15:17:16 +0100
commit20d105a65d305c724948ce389654c74cacac013c (patch)
treeb0a99ceeb7c4264558893b2e086a6b3117941667 /src/buildtool/common/cli.hpp
parent4f306e033ba5523b3b07ca8c709b609f0c117cf1 (diff)
downloadjustbuild-20d105a65d305c724948ce389654c74cacac013c.tar.gz
gc: add option --no-rotation
... to clean up what can be done without losing cache information.
Diffstat (limited to 'src/buildtool/common/cli.hpp')
-rw-r--r--src/buildtool/common/cli.hpp12
1 files changed, 12 insertions, 0 deletions
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<std::filesystem::path> repositories{};
};
+struct GcArguments {
+ bool no_rotate{};
+};
+
static inline auto SetupCommonArguments(
gsl::not_null<CLI::App*> const& app,
gsl::not_null<CommonArguments*> 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<CLI::App*> const& app,
+ gsl::not_null<GcArguments*> 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