mirror of
https://github.com/matrix-construct/construct
synced 2024-09-30 12:48:54 +02:00
modules/console: Basic vm events iteration command.
This commit is contained in:
parent
b729338037
commit
f06505a967
1 changed files with 32 additions and 0 deletions
|
@ -1377,6 +1377,38 @@ console_cmd__key__fetch(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// vm
|
||||
//
|
||||
|
||||
bool
|
||||
console_cmd__vm__events(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"start", "[limit]"
|
||||
}};
|
||||
|
||||
const uint64_t start
|
||||
{
|
||||
param.at<uint64_t>(0, uint64_t(-1))
|
||||
};
|
||||
|
||||
size_t limit
|
||||
{
|
||||
param.at<size_t>(1, 32)
|
||||
};
|
||||
|
||||
m::vm::events::rfor_each(start, [&out, &limit]
|
||||
(const uint64_t &seq, const m::event &event)
|
||||
{
|
||||
out << seq << " " << pretty_oneline(event) << std::endl;;
|
||||
return --limit;
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// event
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue