From 2431ddb10319dfa0ee45c636bfec55a8e95ed045 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 20 Jul 2004 05:26:35 +0000 Subject: [PATCH] Allow help strings for plugins, except plugins that have an explicit command with their name. --- src/Misc.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Misc.py b/src/Misc.py index fb36d6f0d..0636789d3 100755 --- a/src/Misc.py +++ b/src/Misc.py @@ -156,7 +156,7 @@ class Misc(callbacks.Privmsg): else: irc.error('%s has no help.' % name) if len(args) > 1: - cb = irc.getCallback(args[0]) + cb = irc.getCallback(args[0]) # No pop, we'll use this later. if cb is not None: command = callbacks.canonicalName(privmsgs.getArgs(args[1:])) command = command.lstrip(conf.supybot.prefixChars()) @@ -169,7 +169,12 @@ class Misc(callbacks.Privmsg): else: irc.error('There is no such plugin %s.' % args[0]) return - command = callbacks.canonicalName(privmsgs.getArgs(args)) + name = privmsgs.getArgs(args) + cb = irc.getCallback(name) + if cb is not None and cb.__doc__ and not getattr(cb, '_original'): + irc.reply(utils.normalizeWhitespace(cb.__doc__)) + return + command = callbacks.canonicalName(name) # Users might expect "@help @list" to work. command = command.lstrip(conf.supybot.prefixChars()) cbs = callbacks.findCallbackForCommand(irc, command)