43 int main(
int argc,
char* argv[]) {
44 std::string defFile =
"";
45 std::string outFileName =
"testclient_out.txt";
47 std::string host =
"localhost";
49 if ((argc == 1) || (argc % 2 == 0)) {
50 std::cout <<
"Usage: TraCITestClient -def <definition_file> -p <remote port>"
51 <<
"[-h <remote host>] [-o <outputfile name>]" << std::endl;
55 for (
int i = 1; i < argc; i++) {
56 std::string arg = argv[i];
57 if (arg.compare(
"-def") == 0) {
58 defFile = argv[i + 1];
60 }
else if (arg.compare(
"-o") == 0) {
61 outFileName = argv[i + 1];
63 }
else if (arg.compare(
"-p") == 0) {
64 port = atoi(argv[i + 1]);
66 }
else if (arg.compare(
"-h") == 0) {
70 std::cout <<
"unknown parameter: " << argv[i] << std::endl;
76 std::cout <<
"Missing port" << std::endl;
79 if (defFile.compare(
"") == 0) {
80 std::cout <<
"Missing definition file" << std::endl;
85 return !client.
run(defFile, port, host);