Commit 2fc03dc7 authored by Axel Auweter's avatar Axel Auweter
Browse files

Follow-up to #19: Check args before connecting

to the cassandra data store.
parent 4603b723
......@@ -99,26 +99,26 @@ int main(int argc, char* const argv[]) {
*/
signal(SIGINT, sigHandler);
/*
* Allocate and initialize sensor data store.
*/
mySensorDataStore = new SensorDataStore();
/* Parse command line */
char ret;
host="localhost";
while ((ret=getopt(argc, argv, "h:"))!=EOF) {
host="localhost";
while ((ret=getopt(argc, argv, "h:?"))!=EOF) {
switch(ret) {
case 'h':
host = optarg;
break;
case '?':
default:
usage();
exit(EXIT_FAILURE);
case 'h':
host = optarg;
break;
case '?':
default:
usage();
exit(EXIT_FAILURE);
}
}
/*
* Allocate and initialize sensor data store.
*/
mySensorDataStore = new SensorDataStore();
/*
* Start the MQTT Message Server.
*/
......
Supports Markdown
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