From 8c537288d1753bba4468f532a7297fe9b39d30f8 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 3 Sep 2016 09:16:04 -0700 Subject: [PATCH] charybdis: Add -cmd option to drop a command prompt immediately after init. --- charybdis/charybdis.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charybdis/charybdis.cc b/charybdis/charybdis.cc index 1b961d6fa..71b28669b 100644 --- a/charybdis/charybdis.cc +++ b/charybdis/charybdis.cc @@ -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)