diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-05 15:17:47 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-05 15:17:47 +0200 |
| commit | fa35c9c3c71243a7f8537e5a81f7a09fa05a382e (patch) | |
| tree | f87c7a051901bab904d9c9691b79240e1a16da99 /node | |
| parent | 88c5130eccd06e63ffca732626c0fb59426743a7 (diff) | |
| download | cmix-fa35c9c3c71243a7f8537e5a81f7a09fa05a382e.tar.gz cmix-fa35c9c3c71243a7f8537e5a81f7a09fa05a382e.tar.bz2 cmix-fa35c9c3c71243a7f8537e5a81f7a09fa05a382e.zip | |
Fixes some bugs in parsing the program_options.
Diffstat (limited to 'node')
| -rw-r--r-- | node/main.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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<std::string>()->default_value("0.0.0.0"), "Set the ipv4 address to listen on.") ("enable_v6", po::value<bool>()->default_value(true), "Enable/disable ipv6 accept support.") ("interface6,6", po::value<std::string>()->default_value("::"), "Set the ipv6 address to listen on.") - ("next_node,n", po::value<std::string>()->required(), "The address of the next node in the network") + ("next_node,n", po::value<std::string>(), "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>(); + std::string next_node; + if(vm.count("next_node")) { + next_node = vm["next_node"].as<std::string>(); + } else { + std::cerr << "next_node option is required." << std::endl; + return -1; + } Uri uri = parse_uri(next_node); |
