mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 04:39:26 +01:00
Misc: Make @help mention '@plugin help' when relevant.
This commit is contained in:
parent
9323302704
commit
49eef1cd7d
@ -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')])
|
||||
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user