From d3e396f7ecd3bcf2df30d2ba203b3548cf6ab5e0 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Tue, 17 Oct 2023 20:35:54 +0200 Subject: added command line option to start server clean (#481) when specified with `--clean`, the data directory will be wiped clean at startup --- src/zenserver/config.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/zenserver/config.cpp') diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp index 9112222d6..2566d8a3c 100644 --- a/src/zenserver/config.cpp +++ b/src/zenserver/config.cpp @@ -773,6 +773,7 @@ ParseConfigFile(const std::filesystem::path& Path, LuaOptions.AddOption("server.contentdir"sv, ServerOptions.ContentDir, "content-dir"sv); LuaOptions.AddOption("server.abslog"sv, ServerOptions.AbsLogFile, "abslog"sv); LuaOptions.AddOption("server.debug"sv, ServerOptions.IsDebug, "debug"sv); + LuaOptions.AddOption("server.clean"sv, ServerOptions.IsCleanStart, "clean"sv); LuaOptions.AddOption("server.noconsole"sv, ServerOptions.NoConsoleOutput, "quiet"sv); ////// objectstore @@ -925,6 +926,9 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) "Enable dedicated server mode", cxxopts::value(ServerOptions.IsDedicated)->default_value("false")); options.add_options()("d, debug", "Enable debugging", cxxopts::value(ServerOptions.IsDebug)->default_value("false")); + options.add_options()("clean", + "Clean out all state at startup", + cxxopts::value(ServerOptions.IsCleanStart)->default_value("false")); options.add_options()("help", "Show command line help"); options.add_options()("t, test", "Enable test mode", cxxopts::value(ServerOptions.IsTest)->default_value("false")); options.add_options()("log-id", "Specify id for adding context to log output", cxxopts::value(ServerOptions.LogId)); -- cgit v1.2.3