0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

modules/console: Add the die cmd; move exit cmd.

This commit is contained in:
Jason Volk 2018-11-13 10:01:02 -08:00
parent 73def04e3e
commit 10e358d835
2 changed files with 24 additions and 9 deletions

View file

@ -232,15 +232,6 @@ try
if(line == "EXIT")
exit(0);
if(line == "exit")
return false;
if(line == "die")
{
ircd::quit();
return false;
}
int ret{-1};
if(console_module) switch((ret = handle_line_bymodule(line)))
{

View file

@ -405,6 +405,12 @@ console_json(const json::object &object)
// misc
//
bool
console_cmd__exit(opt &out, const string_view &line)
{
return false;
}
bool
console_cmd__debug(opt &out, const string_view &line)
{
@ -426,6 +432,24 @@ console_cmd__debug(opt &out, const string_view &line)
}
}
//
// main
//
bool
console_cmd__die(opt &out, const string_view &line)
{
ircd::quit();
return false;
}
[[noreturn]] bool
console_cmd__die__hard(opt &out, const string_view &line)
{
ircd::terminate();
__builtin_unreachable();
}
//
// log
//