Remove operation help.
[anna.git] / example / diameter / launcher / main.cpp
index 4f11ee2..a827759 100644 (file)
@@ -26,11 +26,15 @@ int main(int argc, const char** argv) {
   anna::Logger::setLevel(anna::Logger::Warning);
 
   // Current working directory and absolute trace path file:
-  char c_exe[ PATH_MAX ];
-  ssize_t count = readlink( "/proc/self/exe", c_exe, PATH_MAX );
-  std::string exe(c_exe, (count > 0) ? count : 0 );
-  std::string cwd = exe.substr(0, exe.find_last_of("/"));
-  std::string trace_file = cwd + "/launcher.trace";
+  char c_cwd[ PATH_MAX ];
+  std::string trace_file;
+  if (getcwd(c_cwd, sizeof(c_cwd)) != NULL) {
+    trace_file = c_cwd;
+    trace_file += "/launcher.trace";
+  } else {
+     perror("getcwd() error");
+     return 1;
+  }
 
   anna::Logger::initialize("launcher", new TraceWriter(trace_file.c_str(), 2048000));
   anna::time::functions::initialize(); // before application instantiation (it have a anna::time object)
@@ -41,12 +45,12 @@ int main(int argc, const char** argv) {
   try {
     anna::CommandLine& commandLine(anna::CommandLine::instantiate());
     // General
-    commandLine.add("services", anna::CommandLine::Argument::Mandatory, "Services xml path file. Shall be validated against dtd schema written on warning traces: 'Services DTD schema'. Empty string or \"null\" name, to start without services (see help for management operation 'services').");
+    commandLine.add("services", anna::CommandLine::Argument::Mandatory, "Services xml path file. Shall be validated against dtd schema written on warning traces: 'Services DTD schema'. Empty string or \"null\" name, to start without services (check 'HELP.md' for more 'services').");
     commandLine.add("trace", anna::CommandLine::Argument::Optional, "Trace level (emergency, alert, critical, error, warning, notice, information, debug, local0..local7)");
     commandLine.add("cntDir", anna::CommandLine::Argument::Optional, "Counters directory. By default is the current execution directory. Warning: a counter file will be dump per record period; take care about the possible accumulation of files");
-    commandLine.add("tmDir", anna::CommandLine::Argument::Optional, "Test manager directory. By default is the current execution directory. Warning: report files could be dump during system testing (see help for management operation 'test|report|result'); take care about the possible accumulation of files");
+    commandLine.add("tmDir", anna::CommandLine::Argument::Optional, "Test manager directory. By default is the current execution directory. Warning: report files could be dump during system testing (check 'HELP.md' for 'test|report|result'); take care about the possible accumulation of files");
     commandLine.add("cntRecordPeriod", anna::CommandLine::Argument::Optional, "Counters record procedure period in milliseconds. If missing, default value of 300000 (5 minutes) will be assigned. Value of 0 disables the record procedure.");
-    commandLine.add("logStatisticSamples", anna::CommandLine::Argument::Optional, "Log statistics samples for the provided comma-separated concept id list, over './sample.<concept id>.csv' files. For example: \"1,2\" will log concepts 1 and 2. Reserved words \"all\"/\"none\" activates/deactivates all registered statistics concept identifiers. That ids are shown at context dump (see help to get it).");
+    commandLine.add("logStatisticSamples", anna::CommandLine::Argument::Optional, "Log statistics samples for the provided comma-separated concept id list, over './sample.<concept id>.csv' files. For example: \"1,2\" will log concepts 1 and 2. Reserved words \"all\"/\"none\" activates/deactivates all registered statistics concept identifiers. That ids are shown at context dump (check 'HELP.md' to get it).");
     commandLine.add("disableLogs", anna::CommandLine::Argument::Optional, "Overrides every node configuration regarding traffic log in order to disable it and ease production or system test startup.", false);
 
     // Communications