diff --git a/plugins/check_nscp_api.cpp b/plugins/check_nscp_api.cpp index 9ba6f7ab8..8a632ef85 100644 --- a/plugins/check_nscp_api.cpp +++ b/plugins/check_nscp_api.cpp @@ -239,11 +239,11 @@ int main(int argc, char **argv) ("help,h", "Print usage message and exit") ("version,V", "Print version and exit") ("debug,d", "Verbose/Debug output") - ("host,H", po::value()->required(), "REQUIRED: NSCP API Host") - ("port,P", po::value()->default_value("8443"), "NSCP API Port (Default: 8443)") - ("password", po::value()->required(), "REQUIRED: NSCP API Password") - ("query,q", po::value()->required(), "REQUIRED: NSCP API Query endpoint") - ("arguments,a", po::value>()->multitoken(), "NSCP API Query arguments for the endpoint"); + ("host,H", po::value()->required(), "REQUIRED: NSCP API Host") + ("port,P", po::value()->default_value("8443"), "NSCP API Port (Default: 8443)") + ("password", po::value()->required(), "REQUIRED: NSCP API Password") + ("query,q", po::value()->required(), "REQUIRED: NSCP API Query endpoint") + ("arguments,a", po::value>()->multitoken(), "NSCP API Query arguments for the endpoint"); po::basic_command_line_parser parser(argc, argv); @@ -281,12 +281,12 @@ int main(int argc, char **argv) } // Create the URL string and escape certain characters since Url() follows RFC 3986 - String endpoint = "/query/" + vm["query"].as(); + String endpoint = "/query/" + vm["query"].as(); if (!vm.count("arguments")) endpoint += '/'; else { endpoint += '?'; - for (String argument : vm["arguments"].as>()) { + for (const String& argument : vm["arguments"].as>()) { String::SizeType pos = argument.FindFirstOf("="); if (pos == String::NPos) endpoint += Utility::EscapeString(argument, ACQUERY_ENCODE, false); @@ -302,8 +302,8 @@ int main(int argc, char **argv) // This needs to happen for HttpRequest to work Application::InitializeBase(); - Dictionary::Ptr result = QueryEndpoint(vm["host"].as(), vm["port"].as(), - vm["password"].as(), endpoint); + Dictionary::Ptr result = QueryEndpoint(vm["host"].as(), vm["port"].as(), + vm["password"].as(), endpoint); // Application::Exit() is the clean way to exit after calling InitializeBase() Application::Exit(FormatOutput(result));