summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2015-10-06 18:15:16 +0200
committerWojciech Siewierski <wojciech.siewierski@onet.pl>2015-10-06 18:28:40 +0200
commit45ee4364794001d783498297017a5d1e846d7fa0 (patch)
tree571844b6034b0b4b9c5bcad9f8cd06b8f6383d64
parent2987d0816ed27f1096f782ce2dbb449e49982333 (diff)
downloadranger-45ee4364794001d783498297017a5d1e846d7fa0.tar.gz
core/actions.py: Hide the internal commands from the "dump_commands" output
- Commands with a docstring starting with a colon (e.g. ":command") are
  added to the output just as before.
- Commands without a docstring whatsoever are listed under the
  "Undocumented commands" category. Again, no change here.
- Commands with a regular docstring are hidden in the "dump_commands"
  output and should be considered an API.
-rw-r--r--ranger/core/actions.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 8167dbcf..a0d8597f 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1113,8 +1113,10 @@ class Actions(FileManagerAware, SettingsAware):
         for cmd_name in sorted(self.commands.commands):
             cmd = self.commands.commands[cmd_name]
             if hasattr(cmd, '__doc__') and cmd.__doc__:
-                write(cleandoc(cmd.__doc__))
-                write("\n\n" + "-" * 60 + "\n")
+                doc = cleandoc(cmd.__doc__)
+                if doc[0] == ':':
+                    write(doc)
+                    write("\n\n" + "-" * 60 + "\n")
             else:
                 undocumented.append(cmd)