0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

modules/console: Add events type counts cmd.

This commit is contained in:
Jason Volk 2019-09-24 17:40:44 -07:00
parent b3f45daff8
commit 7ea609ee67

View file

@ -6710,6 +6710,40 @@ console_cmd__events__type(opt &out, const string_view &line)
return true;
}
bool
console_cmd__events__type__counts(opt &out, const string_view &line)
{
const params param{line, " ",
{
"prefix"
}};
const string_view &prefix
{
param["prefix"]
};
m::events::type::for_each(prefix, [&out]
(const string_view &type)
{
size_t i(0);
m::events::type::for_each_in(type, [&i]
(const string_view &type, const m::event::idx &event_idx)
{
++i;
return true;
});
out
<< std::setw(8) << std::right << i
<< " " << type
<< std::endl;
return true;
});
return true;
}
bool
console_cmd__events__sender(opt &out, const string_view &line)
{