summary refs log tree commit diff stats
path: root/ranger/actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/actions.py')
-rw-r--r--ranger/actions.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/ranger/actions.py b/ranger/actions.py
index 3aef7d86..d85184a3 100644
--- a/ranger/actions.py
+++ b/ranger/actions.py
@@ -152,6 +152,28 @@ class Actions(EnvironmentAware, SettingsAware):
 		"""Handle mouse-buttons if one was pressed"""
 		self.ui.handle_mouse()
 	
+	def display_command_help(self, console_widget):
+		if not hasattr(self.ui, 'open_pager'):
+			return
+
+		try:
+			command = console_widget._get_cmd_class()
+		except:
+			self.notify("Feature not available!", bad=True)
+			return
+
+		if not command:
+			self.notify("Command not found!", bad=True)
+			return
+
+		if not command.__doc__:
+			self.notify("Command has no docstring. Try using python without -OO",
+					bad=True)
+			return
+
+		pager = self.ui.open_pager()
+		pager.set_source(command.__doc__.strip(), strip=True)
+	
 	def display_file(self):
 		if not hasattr(self.ui, 'open_embedded_pager'):
 			return