diff --git a/pushmsg.cpp b/pushmsg.cpp index 8dcdbb2..a976fc3 100644 --- a/pushmsg.cpp +++ b/pushmsg.cpp @@ -34,9 +34,9 @@ void read_options(int argc, char *argv[]) ("help,h", "Display this help and exit.") ("baseurl", po::value()->required(), "Example: https://push.example.org") - ("token", po::value()->required(), "Application token") - ("title", po::value()->required(), "Title of the message") - ("message", po::value(), "Body of the message") + ("token", po::value()->required(), "Application token.") + ("title", po::value(), "Title of the message.") + ("message", po::value()->required(), "Message body.") ("priority", po::value(), "Priority of the message. Default is 5. " "0 = no notification, 1-3 = silent, 4-7 = sound, 8-10 = popup."); @@ -58,11 +58,12 @@ void read_options(int argc, char *argv[]) message.base_url = vm["baseurl"].as(); message.token = vm["token"].as(); - message.title = vm["title"].as(); - if (vm.count("message") != 0) + if (vm.count("title") != 0) + { - message.body = vm["message"].as(); + message.title = vm["title"].as(); } + message.body = vm["message"].as(); if (vm.count("priority") != 0) { message.priority = vm["priority"].as();