mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
modules/console: Add events subcommand accepting filter-JSON argument.
This commit is contained in:
parent
1397091b7c
commit
0d4176a960
1 changed files with 28 additions and 0 deletions
|
@ -1508,6 +1508,34 @@ console_cmd__events(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__events__filter(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"start", "event_filter_json"
|
||||
}};
|
||||
|
||||
const uint64_t start
|
||||
{
|
||||
param.at<uint64_t>(0, uint64_t(-1))
|
||||
};
|
||||
|
||||
const m::event_filter filter
|
||||
{
|
||||
param.at(1)
|
||||
};
|
||||
|
||||
m::events::rfor_each(start, filter, [&out]
|
||||
(const uint64_t &seq, const m::event &event)
|
||||
{
|
||||
out << seq << " " << pretty_oneline(event) << std::endl;;
|
||||
return true;
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// event
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue