diff options
author | hut <hut@lavabit.com> | 2010-01-05 03:00:46 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-01-05 03:00:46 +0100 |
commit | 4b826595915c221f12a4ebe187e990cc7a08f7f2 (patch) | |
tree | cfbe8cffd9add84c915df53bc9ec5355e558bab2 /ranger/actions.py | |
parent | 7e3e8d14402833295ab83ff1591ecbe46867518b (diff) | |
download | ranger-4b826595915c221f12a4ebe187e990cc7a08f7f2.tar.gz |
help: implemented help framework, started writing
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 |