From 07382d8c0afe0f3ed9397cb8a05ac8c0696465c6 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 11 Oct 2020 18:11:29 -0700 Subject: [PATCH] modules/console: Improve the other event refs cmd output. --- modules/console.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/console.cc b/modules/console.cc index 181f8d971..facd1ad9c 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -8411,7 +8411,6 @@ console_cmd__event__refs(opt &out, const string_view &line) empty(typestr)? m::dbs::ref(-1): m::dbs::ref(0) - }; if(!empty(typestr)) @@ -8419,21 +8418,22 @@ console_cmd__event__refs(opt &out, const string_view &line) if(reflect(type) == typestr) break; - refs.for_each(type, [&out] - (const auto &idx, const auto &type) + refs.for_each(type, [&out, &event_id, &refs] + (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) - return true; - - out << idx - << " " << m::event_id(idx) - << " " << reflect(type) - << std::endl; + out + << " " << std::right << std::setw(10) << refs.idx + << " " << std::left << std::setw(45) << trunc(event_id, 45) + << " " << std::right << std::setw(12) << trunc(reflect(type), 12) + << " -> " << std::right << std::setw(10) << tgt + << " " << std::left << std::setw(45) << trunc(tgt_id? string_view{tgt_id}: ""_sv, 45) + << std::endl + ; return true; });