Misc: further simplify custom help logic

This commit is contained in:
James Lu 2014-12-06 18:03:00 -08:00
parent f5bf5129a9
commit 9215bb5754

View File

@ -209,7 +209,7 @@ class Misc(callbacks.Plugin):
not ircdb.checkCapability(msg.prefix, 'owner'): not ircdb.checkCapability(msg.prefix, 'owner'):
irc.errorNoCapability('owner') irc.errorNoCapability('owner')
if unloaded and private: if unloaded and private:
irc.error(_('--private and --unloaded are uncompatible options.')) irc.error(_('--private and --unloaded are incompatible options.'))
return return
if not cb: if not cb:
if unloaded: if unloaded:
@ -294,14 +294,9 @@ class Misc(callbacks.Plugin):
cHelp = self.registryValue("customHelpString") cHelp = self.registryValue("customHelpString")
if cHelp: if cHelp:
irc.reply(cHelp) irc.reply(cHelp)
return else:
try: irc.error()
renames = conf.supybot.commands.renames.get("Misc")() return
if "help" in renames:
ourcmd = conf.supybot.commands.renames.get("Misc").get("help")()
except registry.NonExistentRegistryEntry:
ourcmd = "help"
command = ["misc", ourcmd]
command = list(map(callbacks.canonicalName, command)) command = list(map(callbacks.canonicalName, command))
(maxL, cbs) = irc.findCallbacksForArgs(command) (maxL, cbs) = irc.findCallbacksForArgs(command)
if maxL == command: if maxL == command: