summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-05-18 19:57:16 +0200
committertycho <work.tycho@gmail.com>2015-05-20 02:50:04 +0200
commitd9d4adc2a590768de544dc9d694e0a6550f9dab5 (patch)
treebddb3372884ffcb20a1a4986eb8add7c8ffcbd43 /src/main.cpp
parentMove commlog arguments over to TCLAP (diff)
downloadcuberite-d9d4adc2a590768de544dc9d694e0a6550f9dab5.tar
cuberite-d9d4adc2a590768de544dc9d694e0a6550f9dab5.tar.gz
cuberite-d9d4adc2a590768de544dc9d694e0a6550f9dab5.tar.bz2
cuberite-d9d4adc2a590768de544dc9d694e0a6550f9dab5.tar.lz
cuberite-d9d4adc2a590768de544dc9d694e0a6550f9dab5.tar.xz
cuberite-d9d4adc2a590768de544dc9d694e0a6550f9dab5.tar.zst
cuberite-d9d4adc2a590768de544dc9d694e0a6550f9dab5.zip
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index fdc3c7872..5cd057278 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -380,6 +380,8 @@ std::unique_ptr<cMemorySettingsRepository> parseArguments(int argc, char **argv)
TCLAP::SwitchArg commLogOutArg("", "log-comm-out", "Log outbound server client communications to file", cmd);
+ TCLAP::SwitchArg noBufArg("", "no-output-buffering", "Disable output buffering", cmd);
+
cmd.parse(argc, argv);
auto repo = cpp14::make_unique<cMemorySettingsRepository>();
@@ -413,6 +415,11 @@ std::unique_ptr<cMemorySettingsRepository> parseArguments(int argc, char **argv)
g_ShouldLogCommOut = commLogOutArg.getValue();
}
+ if (noBufArg.getValue())
+ {
+ setvbuf(stdout, nullptr, _IONBF, 0);
+ }
+
repo->SetReadOnly();
return repo;
@@ -490,11 +497,7 @@ int main(int argc, char **argv)
for (int i = 0; i < argc; i++)
{
AString Arg(argv[i]);
- if (NoCaseCompare(Arg, "nooutbuf") == 0)
- {
- setvbuf(stdout, nullptr, _IONBF, 0);
- }
- else if (NoCaseCompare(Arg, "/service") == 0)
+ if (NoCaseCompare(Arg, "/service") == 0)
{
cRoot::m_RunAsService = true;
}