From fa35c9c3c71243a7f8537e5a81f7a09fa05a382e Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Wed, 5 Oct 2016 15:17:47 +0200 Subject: Fixes some bugs in parsing the program_options. --- node/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'node') diff --git a/node/main.cpp b/node/main.cpp index 031e0d0..85b0ca5 100644 --- a/node/main.cpp +++ b/node/main.cpp @@ -22,7 +22,7 @@ int main(int argc, char* argv[]) { ("interface4,4", po::value()->default_value("0.0.0.0"), "Set the ipv4 address to listen on.") ("enable_v6", po::value()->default_value(true), "Enable/disable ipv6 accept support.") ("interface6,6", po::value()->default_value("::"), "Set the ipv6 address to listen on.") - ("next_node,n", po::value()->required(), "The address of the next node in the network") + ("next_node,n", po::value(), "The address of the next node in the network") ("first,f", "This is the first node and will be the communication point for the clients.") ; @@ -44,7 +44,13 @@ int main(int argc, char* argv[]) { ListenSettings lsettings{en4, if4, en6, if6, port}; bool is_first = bool(vm.count("first")); - std::string next_node = vm["next_node"].as(); + std::string next_node; + if(vm.count("next_node")) { + next_node = vm["next_node"].as(); + } else { + std::cerr << "next_node option is required." << std::endl; + return -1; + } Uri uri = parse_uri(next_node); -- cgit v1.2.3-70-g09d2