0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-27 19:28:52 +02:00

modules/console: Add mod sections cmd.

This commit is contained in:
Jason Volk 2019-06-02 16:05:22 -07:00
parent 3c93458d96
commit 068bb44937

View file

@ -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)
{