0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-02 03:32:52 +01:00

modules/console: Improve the other event refs cmd output.

This commit is contained in:
Jason Volk 2020-10-11 18:11:29 -07:00
parent 62fdaaa389
commit 07382d8c0a

View file

@ -8411,7 +8411,6 @@ console_cmd__event__refs(opt &out, const string_view &line)
empty(typestr)? empty(typestr)?
m::dbs::ref(-1): m::dbs::ref(-1):
m::dbs::ref(0) m::dbs::ref(0)
}; };
if(!empty(typestr)) if(!empty(typestr))
@ -8419,21 +8418,22 @@ console_cmd__event__refs(opt &out, const string_view &line)
if(reflect(type) == typestr) if(reflect(type) == typestr)
break; break;
refs.for_each(type, [&out] refs.for_each(type, [&out, &event_id, &refs]
(const auto &idx, const auto &type) (const auto &tgt, const auto &type)
{ {
const m::event::fetch event const auto tgt_id
{ {
std::nothrow, idx m::event_id(std::nothrow, tgt)
}; };
if(!event.valid) out
return true; << " " << std::right << std::setw(10) << refs.idx
<< " " << std::left << std::setw(45) << trunc(event_id, 45)
out << idx << " " << std::right << std::setw(12) << trunc(reflect(type), 12)
<< " " << m::event_id(idx) << " -> " << std::right << std::setw(10) << tgt
<< " " << reflect(type) << " " << std::left << std::setw(45) << trunc(tgt_id? string_view{tgt_id}: "<index error>"_sv, 45)
<< std::endl; << std::endl
;
return true; return true;
}); });