mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
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:
parent
7c89914d2d
commit
0d98118247
@ -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)))
|
||||||
|
@ -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))
|
||||||
|
Loading…
Reference in New Issue
Block a user