mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/console: Add mod sections cmd.
This commit is contained in:
parent
3c93458d96
commit
068bb44937
1 changed files with 30 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue