Network: accept empty args in 'command' and 'cmdall'

Closes GH-1541
This commit is contained in:
James Lu 2023-06-30 19:40:49 -07:00
parent 2902a85dbd
commit b4bf877e77
2 changed files with 5 additions and 2 deletions

View File

@ -150,7 +150,7 @@ class Network(callbacks.Plugin):
Gives the bot <command> (with its associated <arg>s) on <network>.
"""
self.Proxy(otherIrc, msg, commandAndArgs, replyIrc=irc)
command = wrap(command, ['admin', ('networkIrc', True), many('something')])
command = wrap(command, ['admin', ('networkIrc', True), many('anything')])
def cmdall(self, irc, msg, args, commandAndArgs):
"""<command> [<arg> ...]
@ -160,7 +160,7 @@ class Network(callbacks.Plugin):
ircs = world.ircs
for ircd in ircs:
self.Proxy(ircd, msg, commandAndArgs)
cmdall = wrap(cmdall, ['admin', many('something')])
cmdall = wrap(cmdall, ['admin', many('anything')])
###
# whois command-related stuff.

View File

@ -38,6 +38,9 @@ class NetworkTestCase(PluginTestCase):
def testCommand(self):
self.assertResponse('network command %s echo 1' % self.irc.network,
'1')
# empty args should be allowed, see
# https://github.com/progval/Limnoria/issues/1541
self.assertResponse('network command %s len ""' % self.irc.network, '0')
def testCommandRoutesBackToCaller(self):
self.otherIrc = getTestIrc("testnet1")