From ccd8b87ba062a99e91f58bbe2e7494bcf3301aee Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Thu, 1 Jun 2017 01:33:54 +0200 Subject: Correct/suggest command names with the help of damerau levenshtein distance --- src/crsm.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/crsm.hpp') diff --git a/src/crsm.hpp b/src/crsm.hpp index 4e3aa34..c4c8482 100644 --- a/src/crsm.hpp +++ b/src/crsm.hpp @@ -239,9 +239,11 @@ private: void addCommand(const QString& name, CmdFunction func, int interfaces = Clonk | IRC, UserType userType = User, const QString& shortDescription = "", const QString &argList = "", const QString &longDescription = ""); inline void addCommandGroup(const QString& name, int interfaces = Clonk | IRC, UserType userType = User, const QString& shortDescription = "", const QString &longDescription = "", CmdFunction defaultFunc = &CRSM::groupinfo); bool cmdExists(const QString& name, ClientInterface interface); - CmdFunctionRef* findCommand(const QString& cmd, ClientInterface interface, QString& args); - CmdFunctionRef* findCommand(QStringList &&cmd, ClientInterface interface, QString& args); - bool cmd(const QString &cmd, const ClientInfo& client); + QStringList guessCmd(const QString& name, ClientInterface interface); + CmdFunctionRef* findCommand(const QString& cmd, ClientInterface interface, QString& args, QStringList& corrections); + CmdFunctionRef* findCommand(QStringList &&cmd, ClientInterface interface, QString& args, QStringList& corrections); + QString cmdErrorText(const QString& command, const ClientInfo& client, bool& ret); + bool cmd(const QString &cmd, const ClientInfo& client, QStringList& corrections); void rightsFailMessage(const ClientInfo& info, UserType minUserType); UserType clientUserType(const ClientInfo& client); -- cgit v1.2.3-54-g00ecf