407 if (
str.substr(0, 2)==
"h " ||
str.substr(0, 5)==
"help ")
409 const size_t p1 =
str.find_first_of(
' ');
410 const string svc =
str.substr(p1+1);
412 const size_t p3 = svc.find_first_of(
'/');
413 const string s = svc.substr(0, p3);
414 const string c = p3==string::npos?
"":svc.substr(p3+1);
420 lout <<
" " << svc <<
": <not found>" << endl;
425 lout <<
" <no matches found>" <<endl;
431 if (
str.substr(0, 4)==
".js ")
433 string opt(
str.substr(4));
439 lout <<
kRed <<
"JavaScript filename missing." << endl;
441 lout <<
kRed <<
"Equal sign missing in argument '" << data.begin()->first <<
"'" << endl;
468 if (
str.substr(0, 3)==
".s ")
470 istringstream in(
str.substr(3));
472 int state=-100, ms=0;
475 in >> server >> state >> ms;
478 lout <<
kRed <<
"Couldn't parse state id in '" <<
str.substr(3) <<
"'" << endl;
483 const int rc =
JsWait(server, state, ms);
491 if (in.fail() && !in.eof())
493 lout <<
kRed <<
"Invalid label in '" <<
str.substr(3) <<
"'" << endl;
514 if (
str==
"services" ||
str==
"svc")
520 if (
str==
"states" ||
str==
"st")
int Comment(const std::string &str)
StateMachineDimControl * fImp
int JsWait(const string &server, int32_t state, uint32_t ms)
std::ostream & lout
Output stream for local synchrounous output.
bool ProcessCommand(const std::string &str, bool change=true)
bool JsRun(const std::string &, const std::map< std::string, std::string > &=std::map< std::string, std::string >())
std::string fCurrentServer
Output stream for local synchrounous output.
int PrintDescription(std::ostream &out, bool iscmd, const std::string &serv="", const std::string &service="") const
bool Process(std::ostream &out, const std::string &str)
int PrintStates(std::ostream &out, const std::string &serv="") const