mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-10-04 18:38:39 +02:00
Fixed help to show the full command.
This commit is contained in:
parent
b272bd7752
commit
b0e006ab12
@ -168,6 +168,7 @@ class Misc(callbacks.Plugin):
|
|||||||
This command gives a useful description of what <command> does.
|
This command gives a useful description of what <command> does.
|
||||||
<plugin> is only necessary if the command is in more than one plugin.
|
<plugin> is only necessary if the command is in more than one plugin.
|
||||||
"""
|
"""
|
||||||
|
command = map(callbacks.canonicalName, command)
|
||||||
(maxL, cbs) = irc.findCallbacksForArgs(command)
|
(maxL, cbs) = irc.findCallbacksForArgs(command)
|
||||||
if maxL == command:
|
if maxL == command:
|
||||||
if len(cbs) > 1:
|
if len(cbs) > 1:
|
||||||
|
@ -31,7 +31,8 @@ from supybot.test import *
|
|||||||
|
|
||||||
class MiscTestCase(ChannelPluginTestCase):
|
class MiscTestCase(ChannelPluginTestCase):
|
||||||
# plugins = ('Misc', 'Utilities', 'Gameknot', 'Anonymous', 'Dict', 'User')
|
# plugins = ('Misc', 'Utilities', 'Gameknot', 'Anonymous', 'Dict', 'User')
|
||||||
plugins = ('Misc', 'Utilities', 'Anonymous', 'Dict', 'User', 'String')
|
plugins = ('Misc', 'Utilities', 'Anonymous',
|
||||||
|
'Channel', 'Dict', 'User', 'String')
|
||||||
def testReplyWhenNotCommand(self):
|
def testReplyWhenNotCommand(self):
|
||||||
try:
|
try:
|
||||||
original = str(conf.supybot.reply.whenNotCommand)
|
original = str(conf.supybot.reply.whenNotCommand)
|
||||||
@ -71,6 +72,11 @@ class MiscTestCase(ChannelPluginTestCase):
|
|||||||
#self.assertRegexp('help misc help', r'^\(\x02misc help')
|
#self.assertRegexp('help misc help', r'^\(\x02misc help')
|
||||||
self.assertError('help nonExistentCommand')
|
self.assertError('help nonExistentCommand')
|
||||||
|
|
||||||
|
def testHelpIncludeFullCommandName(self):
|
||||||
|
self.assertHelp('help channel capability add')
|
||||||
|
m = self.getMsg('help channel capability add')
|
||||||
|
self.failUnless('channel capability add' in m.args[1])
|
||||||
|
|
||||||
def testHelpDoesAmbiguityWithDefaultPlugins(self):
|
def testHelpDoesAmbiguityWithDefaultPlugins(self):
|
||||||
m = self.getMsg('help list') # Misc.list and User.list.
|
m = self.getMsg('help list') # Misc.list and User.list.
|
||||||
self.failIf(m.args[1].startswith('Error'))
|
self.failIf(m.args[1].startswith('Error'))
|
||||||
|
Loading…
Reference in New Issue
Block a user