You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
551 B
30 lines
551 B
2 years ago
|
#define MICHLIB_NOSOURCE
|
||
|
#include "GPL.h"
|
||
|
#include "odm.h"
|
||
|
|
||
|
CLArgs ParseArgs(int argc, char** argv)
|
||
|
{
|
||
|
CLArgs out;
|
||
|
|
||
|
out["_name"] = argv[0];
|
||
|
for(int i = 0; i < argc; i++)
|
||
|
{
|
||
|
MString carg = argv[i];
|
||
|
out["_arg" + MString(i)] = carg;
|
||
|
|
||
|
for(size_t c = 0; c < carg.Len(); c++)
|
||
|
if(carg[c] == '=')
|
||
|
{
|
||
|
MString name = carg.SubStr(1, c);
|
||
|
MString val = carg.SubStr(c + 2, carg.Len() - c - 1);
|
||
|
out[name] = val;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
SList sl;
|
||
|
michlib_internal::ParseParameterFile("/etc/michlibconf", sl, 0);
|
||
|
|
||
|
return out;
|
||
|
}
|