mirror of https://github.com/Mikaela/Limnoria.git
Added stripping of prefix characters from help argument.
This commit is contained in:
parent
1eb2a387eb
commit
d21a99a37a
|
@ -174,6 +174,8 @@ class MiscCommands(callbacks.Privmsg):
|
||||||
argument list given by the command 'syntax'.
|
argument list given by the command 'syntax'.
|
||||||
"""
|
"""
|
||||||
command = callbacks.canonicalName(privmsgs.getArgs(args))
|
command = callbacks.canonicalName(privmsgs.getArgs(args))
|
||||||
|
# Users might expect "@help @list" to work.
|
||||||
|
command = command.lstrip(conf.prefixChars)
|
||||||
cb = callbacks.findCallbackForCommand(irc, command)
|
cb = callbacks.findCallbackForCommand(irc, command)
|
||||||
if cb:
|
if cb:
|
||||||
method = getattr(cb, command)
|
method = getattr(cb, command)
|
||||||
|
|
|
@ -67,6 +67,7 @@ class MiscCommandsTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||||
|
|
||||||
def testHelp(self):
|
def testHelp(self):
|
||||||
self.assertNotError('help list')
|
self.assertNotError('help list')
|
||||||
|
self.assertNotError('help @list')
|
||||||
self.assertNotError('help syntax')
|
self.assertNotError('help syntax')
|
||||||
self.assertRegexp('help help', r'^\x02\(help')
|
self.assertRegexp('help help', r'^\x02\(help')
|
||||||
self.assertError('help morehelp')
|
self.assertError('help morehelp')
|
||||||
|
|
Loading…
Reference in New Issue