projects
/
oweals
/
minetest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use GenericCAO in place of LuaEntityCAO and PlayerCAO
[oweals/minetest.git]
/
src
/
settings.h
diff --git
a/src/settings.h
b/src/settings.h
index 0b828e2a5a09356e1501758ca9444e24818965ec..b95fbd1845ef4f5eae88ba24f4160b587882134f 100644
(file)
--- 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)
{
bool parseCommandLine(int argc, char *argv[],
core::map<std::string, ValueSpec> &allowed_options)
{
+ int nonopt_index = 0;
int i=1;
for(;;)
{
int i=1;
for(;;)
{
@@
-338,6
+339,15
@@
public:
std::string argname = argv[i];
if(argname.substr(0, 2) != "--")
{
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;
errorstream<<"Invalid command-line parameter \""
<<argname<<"\": --<option> expected."<<std::endl;
return false;