aboutsummaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/main.cpp10
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);