begin major cleanup of "arguement" handling
This commit is contained in:
+63
-61
@@ -853,6 +853,69 @@ static void ApplyLogPreferences()
|
||||
}
|
||||
|
||||
|
||||
//Process args first, put command line options that
|
||||
//have to run before the SM window loads here
|
||||
static void ProcessArgsFirst(int argc, char ** argv)
|
||||
{
|
||||
int argCtr = 1,i; //argv[0] is exe
|
||||
while (argCtr<argc)
|
||||
{
|
||||
CString Arguement(argv[argCtr]);
|
||||
|
||||
// StepMaina.exe argbase=argparameter
|
||||
//Where argparameter can contain = signs
|
||||
|
||||
CString ArgBase;
|
||||
CString ArgParameter;
|
||||
|
||||
for (i=0;i<Arguement.GetLength();i++)
|
||||
if (Arguement.at(i) == '=')
|
||||
break;
|
||||
ArgBase = Arguement.substr(0,i);
|
||||
if (Arguement.GetLength()>i)
|
||||
ArgParameter = Arguement.substr(i+1,Arguement.GetLength()-i-1);
|
||||
|
||||
//For now using an IF/ELSEIF clause
|
||||
if (ArgBase.CompareNoCase("--TESTARGS") == 0)
|
||||
LOG->Info ("Test of arguements requested. Now in First argcheck");
|
||||
else if (ArgBase.CompareNoCase("--NETIP") == 0)
|
||||
NSMAN->StartUp(ArgParameter.c_str());
|
||||
|
||||
|
||||
argCtr++;
|
||||
}
|
||||
}
|
||||
|
||||
static void ProcessArgsSecond(int argc, char ** argv)
|
||||
{
|
||||
int argCtr = 1,i; //argv[0] is exe
|
||||
while (argCtr<argc)
|
||||
{
|
||||
CString Arguement(argv[argCtr]);
|
||||
|
||||
// StepMaina.exe argbase=argparameter
|
||||
//Where argparameter can contain = signs
|
||||
|
||||
CString ArgBase;
|
||||
CString ArgParameter;
|
||||
|
||||
for (i=0;i<Arguement.GetLength();i++)
|
||||
if (Arguement.at(i) == '=')
|
||||
break;
|
||||
ArgBase = Arguement.substr(0,i);
|
||||
if (Arguement.GetLength()>i)
|
||||
ArgParameter = Arguement.substr(i+1,Arguement.GetLength()-i-1);
|
||||
|
||||
//For now using an IF/ELSEIF clause
|
||||
|
||||
if (ArgBase.CompareNoCase("--TESTARGS") == 0)
|
||||
LOG->Info ("Test of arguements requested. Now in Second argcheck");
|
||||
|
||||
|
||||
argCtr++;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
#ifdef _XBOX
|
||||
@@ -1483,64 +1546,3 @@ static void GameLoop()
|
||||
}
|
||||
}
|
||||
|
||||
//Process args first, put command line options that
|
||||
//have to run before the SM window loads here
|
||||
void ProcessArgsFirst(int argc, char ** argv)
|
||||
{
|
||||
int argCtr = 1,i; //argv[0] is exe
|
||||
while (argCtr<argc)
|
||||
{
|
||||
CString Arguement(argv[argCtr]);
|
||||
|
||||
// StepMaina.exe argbase=argparameter
|
||||
//Where argparameter can contain = signs
|
||||
|
||||
CString ArgBase;
|
||||
CString ArgParameter;
|
||||
|
||||
for (i=0;i<Arguement.GetLength();i++)
|
||||
if (Arguement.at(i) == '=')
|
||||
break;
|
||||
ArgBase = Arguement.substr(0,i);
|
||||
if (Arguement.GetLength()>i)
|
||||
ArgParameter = Arguement.substr(i+1,Arguement.GetLength()-i-1);
|
||||
|
||||
//For now using an IF/ELSEIF clause
|
||||
if (ArgBase.CompareNoCase("--TESTARGS") == 0)
|
||||
LOG->Info ("Test of arguements requested. Now in First argcheck");
|
||||
else if (ArgBase.CompareNoCase("--NETIP") == 0)
|
||||
NSMAN->StartUp(ArgParameter.c_str());
|
||||
|
||||
|
||||
argCtr++;
|
||||
}
|
||||
}
|
||||
void ProcessArgsSecond(int argc, char ** argv)
|
||||
{
|
||||
int argCtr = 1,i; //argv[0] is exe
|
||||
while (argCtr<argc)
|
||||
{
|
||||
CString Arguement(argv[argCtr]);
|
||||
|
||||
// StepMaina.exe argbase=argparameter
|
||||
//Where argparameter can contain = signs
|
||||
|
||||
CString ArgBase;
|
||||
CString ArgParameter;
|
||||
|
||||
for (i=0;i<Arguement.GetLength();i++)
|
||||
if (Arguement.at(i) == '=')
|
||||
break;
|
||||
ArgBase = Arguement.substr(0,i);
|
||||
if (Arguement.GetLength()>i)
|
||||
ArgParameter = Arguement.substr(i+1,Arguement.GetLength()-i-1);
|
||||
|
||||
//For now using an IF/ELSEIF clause
|
||||
|
||||
if (ArgBase.CompareNoCase("--TESTARGS") == 0)
|
||||
LOG->Info ("Test of arguements requested. Now in Second argcheck");
|
||||
|
||||
|
||||
argCtr++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user