0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 19:58:53 +02:00

modules/console: Improve event cmd.

This commit is contained in:
Jason Volk 2018-05-20 05:26:14 -07:00
parent c89a7450df
commit 1103eb7fa8

View file

@ -2307,9 +2307,14 @@ console_cmd__events__filter(opt &out, const string_view &line)
bool
console_cmd__event(opt &out, const string_view &line)
{
const params param{line, " ",
{
"event_id"
}};
const m::event::id event_id
{
token(line, ' ', 0)
param.at(0)
};
const auto args
@ -2317,16 +2322,15 @@ console_cmd__event(opt &out, const string_view &line)
tokens_after(line, ' ', 0)
};
static char buf[64_KiB];
const m::event event
const m::event::fetch event
{
event_id, buf
event_id
};
if(!empty(args)) switch(hash(token(args, ' ', 0)))
{
case hash("raw"):
out << json::object{buf} << std::endl;
out << event << std::endl;
return true;
case hash("idx"):