diff options
author | hut <hut@lavabit.com> | 2010-01-19 21:23:02 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-01-19 21:23:02 +0100 |
commit | f24e301824daff6cd5513c6931a05bd305ba11e5 (patch) | |
tree | dec79336cb74788273575a44e67d72e05f9e8dad | |
parent | af6658b377d145529e0b9304247ed3b9b6e40856 (diff) | |
download | ranger-f24e301824daff6cd5513c6931a05bd305ba11e5.tar.gz |
commands: forbid to abbreviate :delete with :d (to avoid mistakes)
-rw-r--r-- | ranger/commands.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ranger/commands.py b/ranger/commands.py index 0cfe78b6..a4074075 100644 --- a/ranger/commands.py +++ b/ranger/commands.py @@ -20,6 +20,7 @@ from ranger.ext.command_parser import LazyParser as parse class Command(FileManagerAware): """Abstract command class""" name = None + allow_abbrev = True def __init__(self, line, mode): self.line = line self.mode = mode @@ -251,6 +252,8 @@ class delete(Command): use the "current file" (where the cursor is) """ + allow_abbrev = False + def execute(self): self.fm.delete() @@ -410,7 +413,9 @@ def alias(**kw): def get_command(name, abbrev=True): if abbrev: - lst = [cls for cmd, cls in by_name.items() if cmd.startswith(name)] + lst = [cls for cmd, cls in by_name.items() \ + if cmd.startswith(name) \ + and cls.allow_abbrev] if len(lst) == 0: raise KeyError if len(lst) == 1: |