Fixed help to show the full command.

This commit is contained in:
Jeremy Fincher 2005-02-24 12:50:09 +00:00
parent b272bd7752
commit b0e006ab12
2 changed files with 8 additions and 1 deletions

View File

@ -168,6 +168,7 @@ class Misc(callbacks.Plugin):
This command gives a useful description of what <command> does.
<plugin> is only necessary if the command is in more than one plugin.
"""
command = map(callbacks.canonicalName, command)
(maxL, cbs) = irc.findCallbacksForArgs(command)
if maxL == command:
if len(cbs) > 1:

View File

@ -31,7 +31,8 @@ from supybot.test import *
class MiscTestCase(ChannelPluginTestCase):
# 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):
try:
original = str(conf.supybot.reply.whenNotCommand)
@ -71,6 +72,11 @@ class MiscTestCase(ChannelPluginTestCase):
#self.assertRegexp('help misc help', r'^\(\x02misc help')
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):
m = self.getMsg('help list') # Misc.list and User.list.
self.failIf(m.args[1].startswith('Error'))