mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Made 'alias foo bar' work as expected.
This commit is contained in:
parent
c1313130a8
commit
f7010805ee
@ -276,6 +276,9 @@ class Alias(callbacks.Privmsg):
|
||||
arguments.
|
||||
"""
|
||||
(name, alias) = privmsgs.getArgs(args, required=2)
|
||||
if ' ' not in alias:
|
||||
# If it's a single word, they probably want $*.
|
||||
alias += ' $*'
|
||||
try:
|
||||
self.addAlias(irc, name, alias)
|
||||
self.log.info('Adding alias %r for %r (from %s)' %
|
||||
|
@ -79,7 +79,7 @@ class AliasTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
|
||||
def testAliasHelp(self):
|
||||
self.assertNotError('alias add slashdot foo')
|
||||
self.assertRegexp('help slashdot', "Alias for 'foo'")
|
||||
self.assertRegexp('help slashdot', "Alias for 'foo.*'")
|
||||
|
||||
def testRemove(self):
|
||||
self.assertNotError('alias add foo echo bar')
|
||||
@ -151,6 +151,10 @@ class AliasTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
def testNoExtraQuotes(self):
|
||||
self.assertNotError('alias add myre "echo s/$1/$2/g"')
|
||||
self.assertResponse('myre foo bar', 's/foo/bar/g')
|
||||
|
||||
def testSimpleAliasWithoutArgsImpliesDollarStar(self):
|
||||
self.assertNotError('alias add exo echo')
|
||||
self.assertResponse('exo foo bar baz', 'foo bar baz')
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user