diff --git a/plugins/Alias.py b/plugins/Alias.py index d96d6606f..48c618e19 100644 --- a/plugins/Alias.py +++ b/plugins/Alias.py @@ -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)' % diff --git a/test/test_Alias.py b/test/test_Alias.py index 13321ee6b..7e7ef984f 100644 --- a/test/test_Alias.py +++ b/test/test_Alias.py @@ -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')