Changed how command not found errors are handled by default: Implemented a cos-likeness algorithm (Coling 2008) for comparing strings, which allows for decent suggestions and speed.

This commit is contained in:
Griatch 2012-04-22 16:36:31 +02:00
parent 4678234e9a
commit 0c292b5ff2
4 changed files with 76 additions and 12 deletions

View file

@ -382,3 +382,12 @@ class CmdSet(object):
by use of self.add().
"""
pass
def get_all_cmd_keys_and_aliases(self):
"""
Returns a list of all command keys and aliases
available in this cmdset.
"""
names = [cmd.key for cmd in self.commands]
[names.extend(cmd.aliases) for cmd in self.commands]
return names