Moved no buffering command line argument to tclap
This commit is contained in:
parent
7c196ffde6
commit
d9d4adc2a5
13
src/main.cpp
13
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 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);
|
cmd.parse(argc, argv);
|
||||||
|
|
||||||
auto repo = cpp14::make_unique<cMemorySettingsRepository>();
|
auto repo = cpp14::make_unique<cMemorySettingsRepository>();
|
||||||
@ -413,6 +415,11 @@ std::unique_ptr<cMemorySettingsRepository> parseArguments(int argc, char **argv)
|
|||||||
g_ShouldLogCommOut = commLogOutArg.getValue();
|
g_ShouldLogCommOut = commLogOutArg.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (noBufArg.getValue())
|
||||||
|
{
|
||||||
|
setvbuf(stdout, nullptr, _IONBF, 0);
|
||||||
|
}
|
||||||
|
|
||||||
repo->SetReadOnly();
|
repo->SetReadOnly();
|
||||||
|
|
||||||
return repo;
|
return repo;
|
||||||
@ -490,11 +497,7 @@ int main(int argc, char **argv)
|
|||||||
for (int i = 0; i < argc; i++)
|
for (int i = 0; i < argc; i++)
|
||||||
{
|
{
|
||||||
AString Arg(argv[i]);
|
AString Arg(argv[i]);
|
||||||
if (NoCaseCompare(Arg, "nooutbuf") == 0)
|
if (NoCaseCompare(Arg, "/service") == 0)
|
||||||
{
|
|
||||||
setvbuf(stdout, nullptr, _IONBF, 0);
|
|
||||||
}
|
|
||||||
else if (NoCaseCompare(Arg, "/service") == 0)
|
|
||||||
{
|
{
|
||||||
cRoot::m_RunAsService = true;
|
cRoot::m_RunAsService = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user