From 068bb44937615efeca3cd1deb4e1da69e9c70d6b Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 2 Jun 2019 16:05:22 -0700 Subject: [PATCH] modules/console: Add mod sections cmd. --- modules/console.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/modules/console.cc b/modules/console.cc index a0583a4a0..ec88c7024 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -1476,6 +1476,36 @@ console_cmd__mod__path(opt &out, const string_view &line) return true; } +bool +console_cmd__mod__sections(opt &out, const string_view &line) +{ + const params param{line, " ", + { + "path" + }}; + + const string_view path + { + param.at("path") + }; + + auto sections(mods::sections(path)); + std::sort(begin(sections), end(sections)); + for(const auto &name : sections) + { + out << name; + + const auto &symbols(mods::symbols(path, name)); + if(!symbols.empty()) + out << " (" << symbols.size() << ")"; + + out << std::endl; + } + + out << std::endl; + return true; +} + bool console_cmd__mod__symbols(opt &out, const string_view &line) {