+ // If a world name was specified, convert it to a path
+ if(commanded_worldname != ""){
+ // Get information about available worlds
+ std::vector<WorldSpec> worldspecs = getAvailableWorlds();
+ bool found = false;
+ for(u32 i=0; i<worldspecs.size(); i++){
+ std::string name = worldspecs[i].name;
+ if(name == commanded_worldname){
+ if(commanded_world != ""){
+ dstream<<_("--worldname takes precedence over previously "
+ "selected world.")<<std::endl;
+ }
+ commanded_world = worldspecs[i].path;
+ found = true;
+ break;
+ }
+ }
+ if(!found){
+ dstream<<_("World")<<" '"<<commanded_worldname<<_("' not "
+ "available. Available worlds:")<<std::endl;
+ print_worldspecs(worldspecs, dstream);
+ return 1;
+ }
+ }
+