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,
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