Made a change to the cmdset comparison algorithm to make sure all commands are compared both by alias and key by use of a set-intersection operation. Before one side of the comparison used key and the other used key+aliases, which led to inconsistent results in some situations, especially when combining system commands with aliases.

This commit is contained in:
Griatch 2015-06-28 17:58:42 +02:00
parent 3cc816c58c
commit 45e0785c8e
2 changed files with 3 additions and 2 deletions

View file

@ -184,7 +184,8 @@ class Command(object):
"""
try:
# first assume input is a command (the most common case)
return cmd.key in self._matchset
return self._matchset.intersection(cmd._matchset)
#return cmd.key in self._matchset
except AttributeError:
# probably got a string
return cmd in self._matchset