From cf94e623ff3c3dcdd4ca6a59632d48bd17b75d55 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 2 Aug 2015 22:52:48 +0200 Subject: 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. --- sm-http-server.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sm-http-server.cpp') 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(&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; } -- cgit v1.2.3