diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-13 01:32:21 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-13 01:46:19 +0200 |
commit | 71a3c2fcd13051dbaed45c69107a6e6b4a94cfe8 (patch) | |
tree | 0251c4848a519fe5accf7964529a22a873a87822 /src/settings.h | |
parent | 4ff36696ea0451c9017cc98d5cc29b0998badba5 (diff) | |
download | hax-minetest-server-71a3c2fcd13051dbaed45c69107a6e6b4a94cfe8.tar.gz hax-minetest-server-71a3c2fcd13051dbaed45c69107a6e6b4a94cfe8.zip |
Allow directly supplying world as a parameter, including world.mt
Diffstat (limited to 'src/settings.h')
-rw-r--r-- | src/settings.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/settings.h b/src/settings.h index 0b828e2a5..b95fbd184 100644 --- a/src/settings.h +++ b/src/settings.h @@ -330,6 +330,7 @@ public: bool parseCommandLine(int argc, char *argv[], core::map<std::string, ValueSpec> &allowed_options) { + int nonopt_index = 0; int i=1; for(;;) { @@ -338,6 +339,15 @@ public: std::string argname = argv[i]; if(argname.substr(0, 2) != "--") { + // If option doesn't start with -, read it in as nonoptX + if(argname[0] != '-'){ + std::string name = "nonopt"; + name += itos(nonopt_index); + set(name, argname); + nonopt_index++; + i++; + continue; + } errorstream<<"Invalid command-line parameter \"" <<argname<<"\": --<option> expected."<<std::endl; return false; |