mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-04 12:29:27 +00:00
Sort the list of commands when using the help command of linphone-daemon.
This commit is contained in:
parent
26aa71233c
commit
dc597140e1
1 changed files with 7 additions and 1 deletions
|
|
@ -25,6 +25,10 @@ HelpCommand::HelpCommand() :
|
|||
DaemonCommand("help", "help <command>", "Show <command> help notice, if command is unspecified or inexistent show all commands.") {
|
||||
}
|
||||
|
||||
static bool compareCommand(const DaemonCommand *command1, const DaemonCommand *command2) {
|
||||
return (command1->getProto() < command2->getProto());
|
||||
}
|
||||
|
||||
void HelpCommand::exec(Daemon *app, const char *args) {
|
||||
ostringstream ost;
|
||||
list<DaemonCommand*>::const_iterator it;
|
||||
|
|
@ -40,7 +44,9 @@ void HelpCommand::exec(Daemon *app, const char *args) {
|
|||
}
|
||||
|
||||
if (args==NULL){
|
||||
for (it = l.begin(); it != l.end(); ++it) {
|
||||
list<DaemonCommand*> lcopy = l;
|
||||
lcopy.sort(compareCommand);
|
||||
for (it = lcopy.begin(); it != lcopy.end(); ++it) {
|
||||
ost << (*it)->getProto() << endl;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue