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))
else:
assert cbs, 'Odd, maxL == command, but no cbs.'
irc.reply(cbs[0].getCommandHelp(command))
irc.reply(cbs[0].getCommandHelp(command, False))
else:
irc.error(format('There is no command %q.',
callbacks.formatCommand(command)))

View File

@ -1197,13 +1197,15 @@ class Commands(BasePlugin):
else:
irc.replyError()
def getCommandHelp(self, command):
def getCommandHelp(self, command, simpleSyntax=None):
method = self.getCommandMethod(command)
help = getHelp
chan = None
if dynamic.msg is not None:
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
if hasattr(method, '__doc__'):
return help(method, name=formatCommand(command))