reslove sortedHelp output .-.

This commit is contained in:
lucaspalomodevelop 2023-10-07 15:13:26 +02:00
parent 807d7b9ff5
commit 466d088921

View File

@ -45,10 +45,17 @@ public:
std::string getHelpAsString()
{
std::string help = "";
for (auto &commandInfo : this->commands)
std::list<commandInfo> sortedCommands = this->commands;
sortedCommands.sort([](const commandInfo &a, const commandInfo &b) {
return a.name < b.name;
});
for (auto &commandInfo : sortedCommands)
{
help += commandInfo.name + " - " + commandInfo.description + "\n";
}
return help;
}