mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 08:24:08 +01:00
charybdis: Add -cmd option to drop a command prompt immediately after init.
This commit is contained in:
parent
f076b33724
commit
8c537288d1
1 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,7 @@ using ircd::lgetopt;
|
|||
|
||||
bool printversion;
|
||||
bool testing_conf;
|
||||
bool cmdline;
|
||||
const char *configfile;
|
||||
lgetopt opts[] =
|
||||
{
|
||||
|
@ -35,6 +36,7 @@ lgetopt opts[] =
|
|||
{ "configfile", &configfile, lgetopt::STRING, "File to use for ircd.conf" },
|
||||
{ "conftest", &testing_conf, lgetopt::YESNO, "Test the configuration files and exit" },
|
||||
{ "debug", &ircd::debugmode, lgetopt::BOOL, "Enable options for debugging" },
|
||||
{ "cmd", &cmdline, lgetopt::BOOL, "Interrupt to a command line immediately after startup" },
|
||||
{ nullptr, nullptr, lgetopt::STRING, nullptr },
|
||||
};
|
||||
|
||||
|
@ -84,6 +86,10 @@ try
|
|||
|
||||
const std::string confpath(configfile?: path::get(path::IRCD_CONF));
|
||||
ircd::init(ios, confpath);
|
||||
|
||||
if(cmdline)
|
||||
raise(SIGINT);
|
||||
|
||||
ios.run(); // Blocks until a clean exit or an exception comes out of it.
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
|
|
Loading…
Reference in a new issue