summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-02-16 01:14:28 +0100
committerhut <hut@lepus.uberspace.de>2015-02-16 01:15:29 +0100
commit45231bda1010421be002e5c485a07539edb0b140 (patch)
tree5255ca9fe1e952bc4683a7965b9f6a9fb7b8d5fb
parent9c1f5c2a8c3c803c003babc67e2a933d663315ca (diff)
downloadranger-45231bda1010421be002e5c485a07539edb0b140.tar.gz
config/commands: interactive "?" key / ":help" command
-rw-r--r--ranger/config/commands.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 5bad4472..b6edf0e9 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -875,14 +875,20 @@ class help_(Command):
     """
     name = 'help'
     def execute(self):
-        if self.quantifier == 1:
-            self.fm.dump_keybindings()
-        elif self.quantifier == 2:
-            self.fm.dump_commands()
-        elif self.quantifier == 3:
-            self.fm.dump_settings()
-        else:
-            self.fm.display_help()
+        def callback(answer):
+            if answer == "q":
+                return
+            elif answer == "m":
+                self.fm.display_help()
+            elif answer == "c":
+                self.fm.dump_commands()
+            elif answer == "k":
+                self.fm.dump_keybindings()
+            elif answer == "s":
+                self.fm.dump_settings()
+
+        c = self.fm.ui.console.ask("View [m]an page, [k]ey bindings,"
+                " [c]ommands or [s]ettings? (press q to abort)", callback, list("mkcsq") + [chr(27)])
 
 
 class copymap(Command):