mirror of
https://github.com/matrix-construct/construct
synced 2025-01-16 09:36:54 +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 printversion;
|
||||||
bool testing_conf;
|
bool testing_conf;
|
||||||
|
bool cmdline;
|
||||||
const char *configfile;
|
const char *configfile;
|
||||||
lgetopt opts[] =
|
lgetopt opts[] =
|
||||||
{
|
{
|
||||||
|
@ -35,6 +36,7 @@ lgetopt opts[] =
|
||||||
{ "configfile", &configfile, lgetopt::STRING, "File to use for ircd.conf" },
|
{ "configfile", &configfile, lgetopt::STRING, "File to use for ircd.conf" },
|
||||||
{ "conftest", &testing_conf, lgetopt::YESNO, "Test the configuration files and exit" },
|
{ "conftest", &testing_conf, lgetopt::YESNO, "Test the configuration files and exit" },
|
||||||
{ "debug", &ircd::debugmode, lgetopt::BOOL, "Enable options for debugging" },
|
{ "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 },
|
{ nullptr, nullptr, lgetopt::STRING, nullptr },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -84,6 +86,10 @@ try
|
||||||
|
|
||||||
const std::string confpath(configfile?: path::get(path::IRCD_CONF));
|
const std::string confpath(configfile?: path::get(path::IRCD_CONF));
|
||||||
ircd::init(ios, confpath);
|
ircd::init(ios, confpath);
|
||||||
|
|
||||||
|
if(cmdline)
|
||||||
|
raise(SIGINT);
|
||||||
|
|
||||||
ios.run(); // Blocks until a clean exit or an exception comes out of it.
|
ios.run(); // Blocks until a clean exit or an exception comes out of it.
|
||||||
}
|
}
|
||||||
catch(const std::exception &e)
|
catch(const std::exception &e)
|
||||||
|
|
Loading…
Reference in a new issue