From: Perttu Ahola Date: Sun, 20 May 2012 14:09:46 +0000 (+0300) Subject: --world list X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=7c15d793acf51595eb614957bc675a34a0320ea5;p=zefram%2Fminetest%2Fminetest_engine.git --world list --- diff --git a/src/main.cpp b/src/main.cpp index c1ed70fa..ec305d4b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -790,7 +790,7 @@ int main(int argc, char *argv[]) allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING, "Same as --world (deprecated)")); allowed_options.insert("world", ValueSpec(VALUETYPE_STRING, - "Set world path (implies local game)")); + "Set world path (implies local game) ('list' lists all)")); allowed_options.insert("worldname", ValueSpec(VALUETYPE_STRING, "Set world by name (implies local game)")); allowed_options.insert("info", ValueSpec(VALUETYPE_FLAG, @@ -909,6 +909,14 @@ int main(int argc, char *argv[]) return 0; } + // List worlds if requested + if(cmd_args.exists("world") && cmd_args.get("world") == "list"){ + dstream<<"Available worlds:"< worldspecs = getAvailableWorlds(); + print_worldspecs(worldspecs, dstream); + return 0; + } + // Print startup message infostream<