summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorGareth Nelson <gareth@garethnelson.com>2017-02-22 14:10:32 +0100
committerMattes D <github@xoft.cz>2017-02-22 14:10:32 +0100
commit1c31cb7eecc92d2fb218da8948e3201b618a46d2 (patch)
tree48212c2758941cd4bc1115fa8bdd91356c341d65 /src/main.cpp
parentAdd 1.11.1/1.11.2 protocol (#3575) (diff)
downloadcuberite-1c31cb7eecc92d2fb218da8948e3201b618a46d2.tar
cuberite-1c31cb7eecc92d2fb218da8948e3201b618a46d2.tar.gz
cuberite-1c31cb7eecc92d2fb218da8948e3201b618a46d2.tar.bz2
cuberite-1c31cb7eecc92d2fb218da8948e3201b618a46d2.tar.lz
cuberite-1c31cb7eecc92d2fb218da8948e3201b618a46d2.tar.xz
cuberite-1c31cb7eecc92d2fb218da8948e3201b618a46d2.tar.zst
cuberite-1c31cb7eecc92d2fb218da8948e3201b618a46d2.zip
Diffstat (limited to '')
-rw-r--r--src/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 83056bf61..4ae54511b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -8,6 +8,8 @@
#include <csignal>
#include <stdlib.h>
+
+
#ifdef ANDROID
// Workaround for Android NDK builds that do not support std::to_string
namespace std
@@ -381,6 +383,7 @@ static std::unique_ptr<cMemorySettingsRepository> ParseArguments(int argc, char
// Parse the comand line args:
TCLAP::CmdLine cmd("Cuberite");
TCLAP::ValueArg<int> slotsArg ("s", "max-players", "Maximum number of slots for the server to use, overrides setting in setting.ini", false, -1, "number", cmd);
+ TCLAP::ValueArg<AString> confArg ("c", "config-file", "Config file to use", false, "settings.ini", "string", cmd);
TCLAP::MultiArg<int> portsArg ("p", "port", "The port number the server should listen to", false, "port", cmd);
TCLAP::SwitchArg commLogArg ("", "log-comm", "Log server client communications to file", cmd);
TCLAP::SwitchArg commLogInArg ("", "log-comm-in", "Log inbound server client communications to file", cmd);
@@ -393,6 +396,11 @@ static std::unique_ptr<cMemorySettingsRepository> ParseArguments(int argc, char
// Copy the parsed args' values into a settings repository:
auto repo = cpp14::make_unique<cMemorySettingsRepository>();
+ if (confArg.isSet())
+ {
+ AString conf_file = confArg.getValue();
+ repo->AddValue("Server", "ConfigFile", conf_file);
+ }
if (slotsArg.isSet())
{
int slots = slotsArg.getValue();