diff options
Diffstat (limited to 'ranger/actions.py')
-rw-r--r-- | ranger/actions.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ranger/actions.py b/ranger/actions.py index 8209c9ab..230f944f 100644 --- a/ranger/actions.py +++ b/ranger/actions.py @@ -187,6 +187,21 @@ class Actions(EnvironmentAware, SettingsAware): lines = cleandoc(command.__doc__).split('\n') pager.set_source(lines) + def display_help(self, topic='index', narg=None): + if not hasattr(self.ui, 'open_pager'): + return + + from ranger.help import get_help, get_help_by_index + + if narg is not None: + help_text = get_help_by_index(narg) + else: + help_text = get_help(topic) + + pager = self.ui.open_pager() + lines = help_text.split('\n') + pager.set_source(lines) + def display_log(self): if not hasattr(self.ui, 'open_pager'): return |