Allow getCommandHelp to be told whether to use simpleSyntax.

Use this to force Misc.help to ignore simpleSyntax since the user has
explicitly asked for the help.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2009-05-18 03:12:54 -04:00
parent 7c89914d2d
commit 0d98118247
2 changed files with 5 additions and 3 deletions

View File

@ -197,7 +197,7 @@ class Misc(callbacks.Plugin):
'you want help with.', names)) 'you want help with.', names))
else: else:
assert cbs, 'Odd, maxL == command, but no cbs.' assert cbs, 'Odd, maxL == command, but no cbs.'
irc.reply(cbs[0].getCommandHelp(command)) irc.reply(cbs[0].getCommandHelp(command, False))
else: else:
irc.error(format('There is no command %q.', irc.error(format('There is no command %q.',
callbacks.formatCommand(command))) callbacks.formatCommand(command)))

View File

@ -1197,13 +1197,15 @@ class Commands(BasePlugin):
else: else:
irc.replyError() irc.replyError()
def getCommandHelp(self, command): def getCommandHelp(self, command, simpleSyntax=None):
method = self.getCommandMethod(command) method = self.getCommandMethod(command)
help = getHelp help = getHelp
chan = None chan = None
if dynamic.msg is not None: if dynamic.msg is not None:
chan = dynamic.msg.args[0] chan = dynamic.msg.args[0]
if conf.get(conf.supybot.reply.showSimpleSyntax, chan): if simpleSyntax is None:
simpleSyntax = conf.get(conf.supybot.reply.showSimpleSyntax, chan)
if simpleSyntax:
help = getSyntax help = getSyntax
if hasattr(method, '__doc__'): if hasattr(method, '__doc__'):
return help(method, name=formatCommand(command)) return help(method, name=formatCommand(command))