mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 02:49:27 +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.'),
|
s = format(_('There is no command %q.'),
|
||||||
callbacks.formatCommand(command))
|
callbacks.formatCommand(command))
|
||||||
if command[0].lower() in map(str.lower, plugins):
|
if command[0].lower() in map(str.lower, plugins):
|
||||||
s += (' However, "{0}" is the name of a loaded plugin, and '
|
if "Plugin" in plugins:
|
||||||
'you may be able to find its provided commands '
|
template = _(
|
||||||
'using \'list {0}\'.'.format(command[0].title()))
|
" 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)
|
irc.error(s)
|
||||||
help = wrap(help, [any('something')])
|
help = wrap(help, [any('something')])
|
||||||
|
|
||||||
|
@ -83,6 +83,20 @@ 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 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):
|
def testHelpIncludeFullCommandName(self):
|
||||||
self.assertHelp('help channel capability add')
|
self.assertHelp('help channel capability add')
|
||||||
m = self.getMsg('help channel capability add')
|
m = self.getMsg('help channel capability add')
|
||||||
|
Loading…
Reference in New Issue
Block a user