diff -r 9b1c277a1b34 -r d9b9bc794d10 tools/main.cpp --- a/tools/main.cpp Thu Jun 05 12:39:46 2008 +0000 +++ b/tools/main.cpp Thu Jun 05 14:33:36 2008 +0000 @@ -8,6 +8,7 @@ #include #include +#include using namespace std; #include "Master.h" @@ -23,6 +24,7 @@ static int slavePosition = DEFAULT_SLAVEPOSITION; static int domainIndex = DEFAULT_DOMAININDEX; static string command = DEFAULT_COMMAND; +vector commandArgs; /*****************************************************************************/ @@ -32,6 +34,7 @@ << "Usage: ethercat [OPTIONS]" << endl << "Commands:" << endl << " data Output binary domain process data." << endl + << " debug Set the master debug level." << endl << " domain Show domain information." << endl << " list (ls, slaves) List all slaves (former 'lsec')." << endl << " pdos List Pdo mapping of given slaves." << endl @@ -131,6 +134,8 @@ } command = argv[optind]; + while (++optind < argc) + commandArgs.push_back(string(argv[optind])); } /****************************************************************************/ @@ -146,6 +151,8 @@ if (command == "data") { master.outputData(domainIndex); + } else if (command == "debug") { + master.setDebug(commandArgs); } else if (command == "domain") { master.showDomains(domainIndex); } else if (command == "list" || command == "ls" || command == "slaves") {