aboutsummaryrefslogtreecommitdiff
path: root/sm-http-server.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-08-02 22:52:48 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-08-02 22:52:48 +0200
commitcf94e623ff3c3dcdd4ca6a59632d48bd17b75d55 (patch)
tree32aab58a0df0054e4e5c3bfe47c0299bfacddf25 /sm-http-server.cpp
parent06c78fe0e2e4e7f0a5ba791571e1986a2e0dab42 (diff)
downloadmqtt-cassandra-bridge-cf94e623ff3c3dcdd4ca6a59632d48bd17b75d55.tar.gz
mqtt-cassandra-bridge-cf94e623ff3c3dcdd4ca6a59632d48bd17b75d55.tar.bz2
mqtt-cassandra-bridge-cf94e623ff3c3dcdd4ca6a59632d48bd17b75d55.tar.xz
mqtt-cassandra-bridge-cf94e623ff3c3dcdd4ca6a59632d48bd17b75d55.zip
o Adding better --help handling.
SM: Using "timestamp_ms" instead of "timestamp" as the timestamp key. SM: On reception, send a "cooked" message with the value of each device. To be improved.
Diffstat (limited to 'sm-http-server.cpp')
-rw-r--r--sm-http-server.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/sm-http-server.cpp b/sm-http-server.cpp
index 6b3169d..b9c3203 100644
--- a/sm-http-server.cpp
+++ b/sm-http-server.cpp
@@ -147,6 +147,7 @@ void on_logging_from_cassandra(const CassLogMessage *message, void *data) {
int main(int argc, const char *const argv[]) {
string cassandra_cluster;
po::options_description all("Options");
+ all.add_options()("help", "Show command options");
all.add_options()("cassandra-cluster", po::value<string>(&cassandra_cluster)->default_value("127.0.0.1"));
po::variables_map vm;
@@ -157,12 +158,13 @@ int main(int argc, const char *const argv[]) {
auto unrecognized = po::collect_unrecognized(parsed.options, po::include_positional);
if (vm.count("help")) {
- cerr << all << "\n";
+ cerr << all << endl;
return EXIT_FAILURE;
}
if (unrecognized.size()) {
- cerr << "Unrecognized option: " << unrecognized.at(0) << "\n";
+ cerr << "Unrecognized option: " << unrecognized.at(0) << endl;
+ cerr << all << endl;
return EXIT_FAILURE;
}