mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
construct: Add a -quiet command line option.
This commit is contained in:
parent
3f939367c0
commit
d065ef1aa4
2 changed files with 7 additions and 0 deletions
|
@ -40,6 +40,7 @@ const char *const usererrstr
|
||||||
|
|
||||||
bool printversion;
|
bool printversion;
|
||||||
bool cmdline;
|
bool cmdline;
|
||||||
|
bool quietmode;
|
||||||
const char *configfile;
|
const char *configfile;
|
||||||
const char *execute;
|
const char *execute;
|
||||||
lgetopt opts[] =
|
lgetopt opts[] =
|
||||||
|
@ -48,6 +49,7 @@ lgetopt opts[] =
|
||||||
{ "version", &printversion, lgetopt::BOOL, "Print version and exit" },
|
{ "version", &printversion, lgetopt::BOOL, "Print version and exit" },
|
||||||
{ "configfile", &configfile, lgetopt::STRING, "File to use for ircd.conf" },
|
{ "configfile", &configfile, lgetopt::STRING, "File to use for ircd.conf" },
|
||||||
{ "debug", &ircd::debugmode, lgetopt::BOOL, "Enable options for debugging" },
|
{ "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" },
|
{ "console", &cmdline, lgetopt::BOOL, "Drop to a command line immediately after startup" },
|
||||||
{ "execute", &execute, lgetopt::STRING, "Execute command lines immediately after startup" },
|
{ "execute", &execute, lgetopt::STRING, "Execute command lines immediately after startup" },
|
||||||
{ "nolisten", &ircd::nolisten, lgetopt::BOOL, "Normal execution but without listening sockets" },
|
{ "nolisten", &ircd::nolisten, lgetopt::BOOL, "Normal execution but without listening sockets" },
|
||||||
|
@ -90,6 +92,9 @@ try
|
||||||
if(printversion)
|
if(printversion)
|
||||||
return print_version();
|
return print_version();
|
||||||
|
|
||||||
|
if(quietmode)
|
||||||
|
ircd::log::console_disable();
|
||||||
|
|
||||||
// The matrix origin is the first positional argument after any switched
|
// The matrix origin is the first positional argument after any switched
|
||||||
// arguments. The matrix origin is the hostpart of MXID's for the server.
|
// arguments. The matrix origin is the hostpart of MXID's for the server.
|
||||||
const ircd::string_view origin
|
const ircd::string_view origin
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
// console.cc
|
// console.cc
|
||||||
//
|
//
|
||||||
|
|
||||||
|
extern bool quietmode;
|
||||||
extern bool console_active;
|
extern bool console_active;
|
||||||
|
|
||||||
void console_spawn();
|
void console_spawn();
|
||||||
void console_execute(const std::vector<std::string> &lines);
|
void console_execute(const std::vector<std::string> &lines);
|
||||||
void console_cancel();
|
void console_cancel();
|
||||||
|
|
Loading…
Reference in a new issue