Browse Source

Added valueless command line parameters

interpolate
Michael Uleysky 3 years ago
parent
commit
2b00649659
  1. 4
      src/ParseArgs.cpp

4
src/ParseArgs.cpp

@ -11,6 +11,7 @@ CLArgs ParseArgs(int argc, char** argv)
{
MString carg = argv[i];
out["_arg" + MString(i)] = carg;
bool namevalue = false;
for(size_t c = 0; c < carg.Len(); c++)
if(carg[c] == '=')
@ -18,8 +19,11 @@ CLArgs ParseArgs(int argc, char** argv)
MString name = carg.SubStr(1, c);
MString val = carg.SubStr(c + 2, carg.Len() - c - 1);
out[name] = val;
namevalue = true;
break;
}
if(!namevalue) out[carg] = "";
}
SList sl;

Loading…
Cancel
Save