Commit bf7aa387 authored by Pavel Vainerman's avatar Pavel Vainerman

(ModbustMaster): исправил обработку --xxx-set-prop-prefix,

а также исправил ошибку в help.
parent 23862161
...@@ -29,9 +29,9 @@ pollThread(0) ...@@ -29,9 +29,9 @@ pollThread(0)
// если "принудительно" задан префикс // если "принудительно" задан префикс
// используем его. // используем его.
{ {
string p("--" + prefix + "-set-prop-prefix"); string p("--" + prefix + "-set-prop-prefix");
string v = conf->getArgParam(p,""); string v = conf->getArgParam(p,"");
if( !v.empty() ) if( !v.empty() && v[0] != '-' )
prop_prefix = v; prop_prefix = v;
// если параметр всё-таки указан, считаем, что это попытка задать "пустой" префикс // если параметр всё-таки указан, считаем, что это попытка задать "пустой" префикс
else if( findArgParam(p,conf->getArgc(),conf->getArgv()) != -1 ) else if( findArgParam(p,conf->getArgc(),conf->getArgv()) != -1 )
...@@ -169,7 +169,7 @@ void MBTCPMaster::help_print( int argc, const char* const* argv ) ...@@ -169,7 +169,7 @@ void MBTCPMaster::help_print( int argc, const char* const* argv )
// ---------- init MBTCP ---------- // ---------- init MBTCP ----------
// cout << "--prefix-sm-ready-timeout - время на ожидание старта SM" << endl; // cout << "--prefix-sm-ready-timeout - время на ожидание старта SM" << endl;
cout << " Настройки протокола TCP: " << endl; cout << " Настройки протокола TCP: " << endl;
cout << "--prefix-gateway hostname,IP - IP опрашиваемого узла" << endl; cout << "--prefix-gateway-iaddr hostname,IP - IP опрашиваемого узла" << endl;
cout << "--prefix-gateway-port num - port на опрашиваемом узле" << endl; cout << "--prefix-gateway-port num - port на опрашиваемом узле" << endl;
cout << "--prefix-persistent-connection 0,1 - Не закрывать соединение на каждом цикле опроса" << endl; cout << "--prefix-persistent-connection 0,1 - Не закрывать соединение на каждом цикле опроса" << endl;
} }
......
...@@ -31,7 +31,7 @@ rs_pre_clean(false) ...@@ -31,7 +31,7 @@ rs_pre_clean(false)
{ {
string p("--" + prefix + "-set-prop-prefix"); string p("--" + prefix + "-set-prop-prefix");
string v = conf->getArgParam(p,""); string v = conf->getArgParam(p,"");
if( !v.empty() ) if( !v.empty() && v[0] != '-' )
prop_prefix = v; prop_prefix = v;
// если параметр всё-таки указан, считаем, что это попытка задать "пустой" префикс // если параметр всё-таки указан, считаем, что это попытка задать "пустой" префикс
else if( findArgParam(p,conf->getArgc(),conf->getArgv()) != -1 ) else if( findArgParam(p,conf->getArgc(),conf->getArgv()) != -1 )
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <cstring>
#include <string> #include <string>
/*! Эти 2 значения используются в TableBlockStorage как флаги для поля count, чтобы не вводить лишнее поле /*! Эти 2 значения используются в TableBlockStorage как флаги для поля count, чтобы не вводить лишнее поле
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment