diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2017-06-01 01:33:54 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2017-06-01 12:10:53 +0200 |
| commit | ccd8b87ba062a99e91f58bbe2e7494bcf3301aee (patch) | |
| tree | 7374048c5153878eb555a5209fe22259a1b9f460 /src/crsm.hpp | |
| parent | 8bd7d77ba07d84b7829201befe30c07b12c5568a (diff) | |
| download | manager-ccd8b87ba062a99e91f58bbe2e7494bcf3301aee.tar.gz manager-ccd8b87ba062a99e91f58bbe2e7494bcf3301aee.zip | |
Correct/suggest command names with the help of damerau levenshtein distance
Diffstat (limited to 'src/crsm.hpp')
| -rw-r--r-- | src/crsm.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
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); |
