1 |
#include "common.h" |
#include "Common.h" |
2 |
|
|
3 |
|
|
4 |
#include "version.h" |
#include "version.h" |
24 |
|
|
25 |
|
|
26 |
Common::Common() |
Common::Common() |
27 |
: _pluginManager(0), _taskManager(0) |
: _pluginManager(0), _taskManager(0) |
28 |
{ |
{ |
29 |
_pluginManager = new PluginManager(); |
_pluginManager = new PluginManager(); |
30 |
_taskManager = new TaskManager(); |
_taskManager = new TaskManager(); |
70 |
cout << " --debug : Run as normal (frontground) process," << endl; |
cout << " --debug : Run as normal (frontground) process," << endl; |
71 |
cout << " with all messages written to std out" << endl; |
cout << " with all messages written to std out" << endl; |
72 |
cout << " --config <file>: Specify which config file to use " << endl; |
cout << " --config <file>: Specify which config file to use " << endl; |
73 |
cout << " default" << configFilePath << endl; |
cout << " default" << configFilePath << endl; |
74 |
cout << " --help : Show this help screen" << endl; |
cout << " --help : Show this help screen" << endl; |
75 |
|
|
76 |
exit(0); |
exit(0); |
84 |
for (int i = 1; i< argc; i++) |
for (int i = 1; i< argc; i++) |
85 |
{ |
{ |
86 |
string current(argv[i]); |
string current(argv[i]); |
87 |
if (current == "--daemon") |
if (current == "--daemon") |
88 |
{ |
{ |
89 |
isDaemon = true; |
isDaemon = true; |
90 |
isDebug = false; |
isDebug = false; |
91 |
|
|
92 |
} |
} |
93 |
else if (current == "--debug") |
else if (current == "--debug") |
94 |
{ |
{ |
97 |
} |
} |
98 |
else if (current == "--config") |
else if (current == "--config") |
99 |
{ |
{ |
100 |
|
i++; |
101 |
|
if ( i<argc) |
102 |
|
{ |
103 |
|
configFilePath = argv[i]; |
104 |
|
} |
105 |
|
else |
106 |
|
{ |
107 |
|
printUsage(); |
108 |
|
exit(1); |
109 |
|
} |
110 |
|
|
111 |
} |
} |
112 |
else if (current == "-h" || current == "--help") |
else if (current == "-h" || current == "--help") |
113 |
{ |
{ |
135 |
out << "Uptime " << diff << " seconds. "; |
out << "Uptime " << diff << " seconds. "; |
136 |
out << "Messages received:" << this->smsCounter.incomming << ". "; |
out << "Messages received:" << this->smsCounter.incomming << ". "; |
137 |
out << "Messages sent:" << this->smsCounter.outgoing << "."; |
out << "Messages sent:" << this->smsCounter.outgoing << "."; |
138 |
|
|
139 |
return out.str(); |
return out.str(); |
140 |
} |
} |