From 1fd393a1fa31686334b3aaafdb034848226a6026 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Thu, 24 Jul 2008 15:12:21 -0400 Subject: [PATCH] cmd_help: show commands provided by plugins --- yap/yap.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/yap/yap.py b/yap/yap.py index fc17832..36092d2 100644 --- a/yap/yap.py +++ b/yap/yap.py @@ -1197,6 +1197,22 @@ commits cannot be made. name = name.replace('cmd_', '') name = name.replace('_', '-') print >> sys.stderr, "%-16s%s" % (name, short_msg) + + print >> sys.stderr + print >> sys.stderr, "Commands provided by plugins:" + for k, v in self.plugins.items(): + for name in dir(v): + if not name.startswith('cmd_'): + continue + try: + attr = self.__getattribute__(name) + short_msg = attr.short_help + except AttributeError: + continue + name = name.replace('cmd_', '') + name = name.replace('_', '-') + print >> sys.stderr, "%-8s(%s) %s" % (name, k, short_msg) + print >> sys.stderr print >> sys.stderr, "(*) Indicates that the command is not readily reversible" -- 2.11.4.GIT