diff options
author | hut <hut@lavabit.com> | 2010-05-07 10:15:16 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-05-10 21:03:40 +0200 |
commit | 1dbc2fcedd9733c50d5a276201bd3d20b05f924e (patch) | |
tree | 0644e2892a9ebd6214e228e2de3b19ef6e449de5 | |
parent | c03637adfa243cc70b9de3e492669ae820a1ac6f (diff) | |
download | ranger-1dbc2fcedd9733c50d5a276201bd3d20b05f924e.tar.gz |
api.commands: fixed :e
-rw-r--r-- | ranger/api/commands.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py index 73975adc..ca3f730d 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -48,13 +48,14 @@ class CommandContainer(object): def get_command(self, name, abbrev=True): if abbrev: lst = [cls for cmd, cls in self.commands.items() \ - if cmd.startswith(name) \ - and cls.allow_abbrev \ + if cls.allow_abbrev and cmd.startswith(name) \ or cmd == name] if len(lst) == 0: raise KeyError - if len(lst) == 1 or self.commands[name] in lst: + if len(lst) == 1: return lst[0] + if self.commands[name] in lst: + return self.commands[name] raise ValueError("Ambiguous command") else: try: |