mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
modules/console: Add events type counts cmd.
This commit is contained in:
parent
b3f45daff8
commit
7ea609ee67
1 changed files with 34 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue