0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-29 15:28:20 +02:00

modules/console: Basic vm events iteration command.

This commit is contained in:
Jason Volk 2018-04-16 16:01:10 -07:00
parent b729338037
commit f06505a967

View file

@ -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
//