Allow help strings for plugins, except plugins that have an explicit command with their name.

This commit is contained in:
Jeremy Fincher 2004-07-20 05:26:35 +00:00
parent 70dd4dba3d
commit 2431ddb103

View File

@ -156,7 +156,7 @@ class Misc(callbacks.Privmsg):
else: else:
irc.error('%s has no help.' % name) irc.error('%s has no help.' % name)
if len(args) > 1: 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: if cb is not None:
command = callbacks.canonicalName(privmsgs.getArgs(args[1:])) command = callbacks.canonicalName(privmsgs.getArgs(args[1:]))
command = command.lstrip(conf.supybot.prefixChars()) command = command.lstrip(conf.supybot.prefixChars())
@ -169,7 +169,12 @@ class Misc(callbacks.Privmsg):
else: else:
irc.error('There is no such plugin %s.' % args[0]) irc.error('There is no such plugin %s.' % args[0])
return 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. # Users might expect "@help @list" to work.
command = command.lstrip(conf.supybot.prefixChars()) command = command.lstrip(conf.supybot.prefixChars())
cbs = callbacks.findCallbackForCommand(irc, command) cbs = callbacks.findCallbackForCommand(irc, command)