picloud add "-w" option for watchdog
This commit is contained in:
@@ -34,13 +34,14 @@ using namespace PICoutManipulators;
|
||||
void usage() {
|
||||
piCout << Bold << "PIP Cloud Dispatcher";
|
||||
piCout << Cyan << "Version" << Bold << PIPVersion() << NewLine;
|
||||
piCout << Green << Bold << "Usage:" << Default << "\"picloud [-hsv] [-i <ip>] [-p <port>]\"" << NewLine;
|
||||
piCout << Green << Bold << "Usage:" << Default << "\"picloud [-hswv] [-i <ip>] [-p <port>]\"" << NewLine;
|
||||
piCout << Green << Bold << "Details:";
|
||||
piCout << "-h --help " << Green << "- display this message and exit";
|
||||
piCout << "-i --ip " << Green << "- listen address, default \"0.0.0.0\"";
|
||||
piCout << "-p --port " << Green << "- listen port, default 10101";
|
||||
piCout << "-s --screen " << Green << "- start with console UI";
|
||||
piCout << "-v --verbose" << Green << "- print state (--screen ignore this flag)";
|
||||
piCout << "-h --help " << Green << "- display this message and exit";
|
||||
piCout << "-i --ip " << Green << "- listen address, default \"0.0.0.0\"";
|
||||
piCout << "-p --port " << Green << "- listen port, default 10101";
|
||||
piCout << "-s --screen " << Green << "- start with console UI";
|
||||
piCout << "-w --watchdog" << Green << "- kill itself on deadlock";
|
||||
piCout << "-v --verbose " << Green << "- print state (--screen ignore this flag)";
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +65,7 @@ int main(int argc, char * argv[]) {
|
||||
cli.addArgument("ip", true);
|
||||
cli.addArgument("port", true);
|
||||
cli.addArgument("screen");
|
||||
cli.addArgument("watchdog");
|
||||
cli.addArgument("verbose");
|
||||
|
||||
if (cli.hasArgument("help")) {
|
||||
@@ -154,6 +156,7 @@ int main(int argc, char * argv[]) {
|
||||
ls.enableExitCapture(PIKbdListener::F10);
|
||||
ls.start();
|
||||
server.start();
|
||||
if (cli.hasArgument("watchdog")) server.startWatchdog();
|
||||
if (cli.hasArgument("verbose")) {
|
||||
CONNECTU(&status_timer, tickEvent, &server, picoutStatus);
|
||||
status_timer.start(1_Hz);
|
||||
|
||||
Reference in New Issue
Block a user