30 lines
607 B
C++
Executable File
30 lines
607 B
C++
Executable File
|
|
|
|
|
|
#include "cbi_help.h"
|
|
#include "workerbase.h"
|
|
|
|
#include <algorithm>
|
|
#include <QtCore/QStringList>
|
|
|
|
CBI_Help::CBI_Help(unsigned short port)
|
|
: CommandInterface(port, "HELP")
|
|
{}
|
|
|
|
void CBI_Help::handleCommandInternal(const QVector<QByteArray> &)
|
|
{
|
|
const auto commands = workerBase()->getCommands();
|
|
QStringList list;
|
|
list.reserve(commands.size());
|
|
for (const CommandInterface *i : commands)
|
|
list += i->help();
|
|
|
|
std::sort(list.begin(), list.end());
|
|
writeData(list.join(QLatin1Char('\n')));
|
|
}
|
|
|
|
QString CBI_Help::help() const
|
|
{
|
|
return QLatin1String("HELP - prints out help informations");
|
|
}
|