imported patch statetracehost.patch
This commit is contained in:
parent
081b6fe9db
commit
1ad4de2528
1 changed files with 13 additions and 1 deletions
|
@ -61,6 +61,7 @@ int main(int argc, char * argv[], char * envp[])
|
|||
//Parse the command line arguments
|
||||
bool printInitial = false;
|
||||
bool printTrace = true;
|
||||
string host = "localhost";
|
||||
for(int x = 1; x < argc; x++)
|
||||
{
|
||||
if(!strcmp(argv[x], "-h"))
|
||||
|
@ -68,6 +69,17 @@ int main(int argc, char * argv[], char * envp[])
|
|||
printUsage(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
if(!strcmp(argv[x], "--host"))
|
||||
{
|
||||
x++;
|
||||
if(x >= argc)
|
||||
{
|
||||
cerr << "Incorrect usage.\n" << endl;
|
||||
printUsage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
host = argv[x];
|
||||
}
|
||||
else if(!strcmp(argv[x], "-r"))
|
||||
{
|
||||
cout << "Legal register names:" << endl;
|
||||
|
@ -127,7 +139,7 @@ int main(int argc, char * argv[], char * envp[])
|
|||
return 1;
|
||||
}
|
||||
struct hostent *server;
|
||||
server = gethostbyname("localhost");
|
||||
server = gethostbyname(host.c_str());
|
||||
if(!server)
|
||||
{
|
||||
cerr << "Couldn't get host ip! " << strerror(errno) << endl;
|
||||
|
|
Loading…
Reference in a new issue