diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-05-20 17:09:46 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-05-20 17:09:46 +0300 |
commit | 7c15d793acf51595eb614957bc675a34a0320ea5 (patch) | |
tree | de9c6f6ed7fd2b197cff0f19c671541a3cd74ec3 | |
parent | d90cb3511c6ae1ee04d3a8ffacdd92bde6a601fe (diff) | |
download | minetest-7c15d793acf51595eb614957bc675a34a0320ea5.tar.gz minetest-7c15d793acf51595eb614957bc675a34a0320ea5.tar.bz2 minetest-7c15d793acf51595eb614957bc675a34a0320ea5.zip |
--world list
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index c1ed70faf..ec305d4bf 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:"<<std::endl; + std::vector<WorldSpec> worldspecs = getAvailableWorlds(); + print_worldspecs(worldspecs, dstream); + return 0; + } + // Print startup message infostream<<PROJECT_NAME<< " with SER_FMT_VER_HIGHEST="<<(int)SER_FMT_VER_HIGHEST |