mirror of
https://github.com/Yet-Another-DreamTeam/quicknote.git
synced 2026-03-13 00:07:25 +00:00
sort command-order for help command
This commit is contained in:
parent
e3325b1bd3
commit
6589f344e4
@ -44,7 +44,14 @@ 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";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user