0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-03 18:48:55 +02:00

construct: Add a -quiet command line option.

This commit is contained in:
Jason Volk 2018-12-05 19:00:43 -08:00
parent 3f939367c0
commit d065ef1aa4
2 changed files with 7 additions and 0 deletions

View file

@ -40,6 +40,7 @@ const char *const usererrstr
bool printversion;
bool cmdline;
bool quietmode;
const char *configfile;
const char *execute;
lgetopt opts[] =
@ -48,6 +49,7 @@ lgetopt opts[] =
{ "version", &printversion, lgetopt::BOOL, "Print version and exit" },
{ "configfile", &configfile, lgetopt::STRING, "File to use for ircd.conf" },
{ "debug", &ircd::debugmode, lgetopt::BOOL, "Enable options for debugging" },
{ "quiet", &quietmode, lgetopt::BOOL, "Suppress log messages at the terminal." },
{ "console", &cmdline, lgetopt::BOOL, "Drop to a command line immediately after startup" },
{ "execute", &execute, lgetopt::STRING, "Execute command lines immediately after startup" },
{ "nolisten", &ircd::nolisten, lgetopt::BOOL, "Normal execution but without listening sockets" },
@ -90,6 +92,9 @@ try
if(printversion)
return print_version();
if(quietmode)
ircd::log::console_disable();
// The matrix origin is the first positional argument after any switched
// arguments. The matrix origin is the hostpart of MXID's for the server.
const ircd::string_view origin

View file

@ -12,7 +12,9 @@
// console.cc
//
extern bool quietmode;
extern bool console_active;
void console_spawn();
void console_execute(const std::vector<std::string> &lines);
void console_cancel();