diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-06-11 17:17:52 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-06-12 17:07:17 +0200 |
commit | cc7350c9c3535b672788e68b5b7082ec441a4d6d (patch) | |
tree | 835f4f6b71063226859f8fa65830cc85693e5286 /src/buildtool/common/cli.hpp | |
parent | 826cfa2022fbce7c3bf22b23b335f2080d878eaa (diff) | |
download | justbuild-cc7350c9c3535b672788e68b5b7082ec441a4d6d.tar.gz |
Add a flag to `gc` command: `--all`
Diffstat (limited to 'src/buildtool/common/cli.hpp')
-rw-r--r-- | src/buildtool/common/cli.hpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index 6b6ad535..ff4db0bb 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -192,7 +192,8 @@ struct ServeArguments { }; struct GcArguments { - bool no_rotate{}; + bool no_rotate = false; + bool all = false; }; struct ToAddArguments { @@ -838,10 +839,17 @@ static inline auto SetupServeArguments( 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."); + auto* no_rotate = + app->add_flag("--no-rotate", + args->no_rotate, + "Do not rotate cache generations, only clean up what can " + "be done without losing cache."); + + auto* all = app->add_flag( + "--all", args->all, "Remove all cache generations at once"); + + no_rotate->excludes(all); + all->excludes(no_rotate); } #endif // INCLUDED_SRC_BUILDTOOL_COMMON_CLI_HPP |