Handle properly the case where no matching commands were found.

This commit is contained in:
Jeremy Fincher 2003-10-27 04:59:54 +00:00
parent a1c911e954
commit fc11ff4f24
2 changed files with 6 additions and 2 deletions

View File

@ -180,8 +180,11 @@ class Misc(callbacks.Privmsg):
else: else:
for name in names: for name in names:
L.append('%s %s' % (name, key)) L.append('%s %s' % (name, key))
if L:
L.sort() L.sort()
irc.reply(msg, utils.commaAndify(L)) irc.reply(msg, utils.commaAndify(L))
else:
irc.error(msg, 'No appropriate commands were found.')
def help(self, irc, msg, args): def help(self, irc, msg, args):
"""[<plugin>] <command> """[<plugin>] <command>

View File

@ -142,6 +142,7 @@ class MiscTestCase(ChannelPluginTestCase, PluginDocumentation):
def testApropos(self): def testApropos(self):
self.assertNotError('apropos f') self.assertNotError('apropos f')
self.assertError('apropos asldkfjasdlkfja')