added sorted help output

This commit is contained in:
lucaspalomodevelop 2023-06-28 12:37:21 +02:00
parent 7cec36d331
commit 243be8220d
2 changed files with 4 additions and 7 deletions

View File

@ -67,9 +67,11 @@ bool Command::isInCommands(std::string name)
std::string Command::listCommands()
{
std::string list = "";
for (auto const &command : commands)
for (std::map<std::string, CommandInfo>::iterator it = commands.begin(); it != commands.end(); ++it)
{
list += "\t" + command.second.name + " " + command.second.description + "\n";
list += "\t" + it->second.name + " " + it->second.description + "\n";
}
return list;
}

View File

@ -36,10 +36,5 @@ void removeScript(int argc, char *argv[]);
void showScript(int argc, char *argv[]);
// help function for showing help message
void help(int argc, char *argv[]);
// void create(int argc,char *argv[]);
// void remove(int argc,char *argv[]);
// void list(int argc,char *argv[]);
// void edit(int argc,char *argv[]);
// void run(int argc,char *argv[]);
#endif // MAIN_H