Skip to content

Instantly share code, notes, and snippets.

@kahrl

kahrl/gist:6514030

Last active Dec 22, 2015
Embed
What would you like to do?
diff --git a/doc/minetest.6 b/doc/minetest.6
index 8099128..f837303 100644
--- a/doc/minetest.6
+++ b/doc/minetest.6
@@ -78,7 +78,7 @@ Set world path
.TP
\-\-migrate <value>
Migrate from current map backend to another. Possible values are sqlite3
-and leveldb. Only works when using --server.
+and leveldb.
.SH BUGS
Please report all bugs to Perttu Ahola <celeron55@gmail.com>.
diff --git a/src/main.cpp b/src/main.cpp
index dfe1e5c..882d61d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -796,7 +796,7 @@ int main(int argc, char *argv[])
allowed_options.insert(std::make_pair("gameid", ValueSpec(VALUETYPE_STRING,
_("Set gameid (\"--gameid list\" prints available ones)"))));
allowed_options.insert(std::make_pair("migrate", ValueSpec(VALUETYPE_STRING,
- _("Migrate from current map backend to another (Only works when using minetestserver or with --server)"))));
+ _("Migrate from current map backend to another"))));
#ifndef SERVER
allowed_options.insert(std::make_pair("videomodes", ValueSpec(VALUETYPE_FLAG,
_("Show available video modes"))));
@@ -1096,11 +1096,16 @@ int main(int argc, char *argv[])
/*
Run dedicated server if asked to or no other option
+
+ Option --migrate is handled in dedicated server branch
+ so check for that as well.
*/
#ifdef SERVER
bool run_dedicated_server = true;
#else
- bool run_dedicated_server = cmd_args.getFlag("server");
+ bool run_dedicated_server =
+ cmd_args.getFlag("server") ||
+ cmd_args.exists("migrate");
#endif
g_settings->set("server_dedicated", run_dedicated_server ? "true" : "false");
if(run_dedicated_server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment