From 0d98118247173f7998fdf823321b32e5cb23a42b Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 18 May 2009 03:12:54 -0400 Subject: [PATCH] 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 --- plugins/Misc/plugin.py | 2 +- src/callbacks.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 8976da53f..5680589fb 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -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))) diff --git a/src/callbacks.py b/src/callbacks.py index 7db2bfa45..3a3fc2fc7 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -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))