diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 522968098..7b934396d 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -314,9 +314,20 @@ class Misc(callbacks.Plugin): s = format(_('There is no command %q.'), callbacks.formatCommand(command)) if command[0].lower() in map(str.lower, plugins): - s += (' However, "{0}" is the name of a loaded plugin, and ' - 'you may be able to find its provided commands ' - 'using \'list {0}\'.'.format(command[0].title())) + if "Plugin" in plugins: + template = _( + " However, '{0}' is the name of a loaded plugin, and " + "you may be able to find its help using " + "'plugin help {0}' and its provided commands using " + "'list {0}'." + ) + else: + template = _( + " However, '{0}' is the name of a loaded plugin, and " + "you may be able to find its provided commands using " + "'list {0}'." + ) + s += template.format(command[0].title()) irc.error(s) help = wrap(help, [any('something')]) diff --git a/plugins/Misc/test.py b/plugins/Misc/test.py index 25fae3753..7aeacf1e8 100644 --- a/plugins/Misc/test.py +++ b/plugins/Misc/test.py @@ -83,6 +83,20 @@ class MiscTestCase(ChannelPluginTestCase): #self.assertRegexp('help misc help', r'^\(\x02misc help') self.assertError('help nonExistentCommand') + def testPluginHelp(self): + self.assertResponse('help Misc', + 'Error: There is no command "misc". ' + "However, 'Misc' is the name of a loaded plugin, " + "and you may be able to find its help using " + "'plugin help Misc' and its provided " + "commands using 'list Misc'.") + self.assertNotError('unload Plugin') + self.assertResponse('help Misc', + 'Error: There is no command "misc". ' + "However, 'Misc' is the name of a loaded plugin, " + "and you may be able to find its provided commands using " + "'list Misc'.") + def testHelpIncludeFullCommandName(self): self.assertHelp('help channel capability add') m = self.getMsg('help channel capability add')