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

modules/console: Add event bad cmd.

This commit is contained in:
Jason Volk 2018-05-04 16:53:29 -07:00
parent 96b84e30ef
commit 85db62ff17

View file

@ -1990,6 +1990,39 @@ console_id__event(opt &out,
return console_cmd__event(out, line); return console_cmd__event(out, line);
} }
bool
console_cmd__event__bad(opt &out, const string_view &line)
{
const params param{line, " ",
{
"event_id",
}};
const m::event::id event_id
{
param.at(0)
};
m::event::idx workaround;
const bool b
{
bad(event_id, workaround)
};
out << event_id << "is"
<< (b? " " : " NOT ") << "BAD";
if(b && workaround != m::event::idx(-1))
m::event::fetch::event_id(workaround, std::nothrow, [&out]
(const m::event::id &event_id)
{
out << " and a workaround is " << event_id;
});
out << std::endl;
return true;
}
bool bool
console_cmd__event__erase(opt &out, const string_view &line) console_cmd__event__erase(opt &out, const string_view &line)
{ {