changed server config parsing
This commit is contained in:
@@ -57,7 +57,7 @@ void FlippRServer::parse_server_config_file()
|
||||
|
||||
try
|
||||
{
|
||||
config.open("./server_config.json");
|
||||
config.open(this->server_config);
|
||||
}
|
||||
catch(const std::exception e)
|
||||
{
|
||||
@@ -249,6 +249,12 @@ void FlippRServer::defineOptions(OptionSet& options)
|
||||
.repeatable(false)
|
||||
.callback(OptionCallback<FlippRServer>(this, &FlippRServer::handle_config_file))
|
||||
.argument("display-config", true));
|
||||
|
||||
options.addOption(Option("server-config", "-s", "Specify where the server-config file is located. Only needed when not in this folder.")
|
||||
.required(this->display_config == "Not set")
|
||||
.repeatable(false)
|
||||
.callback(OptionCallback<FlippRServer>(this, &FlippRServer::handle_config_file))
|
||||
.argument("server-config", true));
|
||||
}
|
||||
|
||||
void FlippRServer::handle_config_file(const std::string &name, const std::string &value)
|
||||
@@ -269,6 +275,8 @@ void FlippRServer::handle_config_file(const std::string &name, const std::string
|
||||
this->input_port = std::stoi(value);
|
||||
else if(name == "output-port")
|
||||
this->output_port = std::stoi(value);
|
||||
else if(name == "server-config")
|
||||
this->server_config = value;
|
||||
else
|
||||
{
|
||||
logger().information("Configuration \"" + name + "\" is not known.");
|
||||
|
||||
Reference in New Issue
Block a user