From 4fa07b58a7408813f2acf90d2fd60ec7ddda3ab7 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 6 Feb 2019 16:29:55 -0800 Subject: [PATCH] modules/console: Add event refs cmd. --- modules/console.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/modules/console.cc b/modules/console.cc index 68a5983c8..faa7ae539 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -5804,6 +5804,36 @@ console_cmd__event__visible(opt &out, const string_view &line) return true; } +bool +console_cmd__event__refs(opt &out, const string_view &line) +{ + const params param{line, " ", + { + "event_id" + }}; + + const m::event::id &event_id + { + param.at("event_id") + }; + + const m::event::refs refs + { + index(event_id) + }; + + refs.for_each([&out](const m::event::idx &idx) + { + out << idx + << " " << m::event_id(idx) + << std::endl; + + return true; + }); + + return true; +} + // // state //