diff options
author | Yaohan Chen <yaohan.chen@gmail.com> | 2007-11-05 04:13:32 +0000 |
---|---|---|
committer | Yaohan Chen <yaohan.chen@gmail.com> | 2007-11-05 04:13:32 +0000 |
commit | 806e6c9a6b5c58997bacf7981ee3c797878b2e48 (patch) | |
tree | e457087d9a965abb1e9c6083bacbebd634a6ae16 /data | |
parent | 2f028b52446362da2e1aa9173fa938c700a6a0cf (diff) |
alias.rb: help message for aliases show alias definitions
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/alias.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/data/rbot/plugins/alias.rb b/data/rbot/plugins/alias.rb index 1496755d..289ef1ad 100644 --- a/data/rbot/plugins/alias.rb +++ b/data/rbot/plugins/alias.rb @@ -154,7 +154,15 @@ class AliasPlugin < Plugin def help(plugin, topic='') case topic when '' - _('Create and use aliases for commands. Topics: create, commands') + if plugin == 'alias' # FIXME find out plugin name programmatically + _('Create and use aliases for commands. Topics: create, commands') + else + # show definition of all aliases whose first word is the parameter of the help + # command + @aliases.keys.select {|a| a[/\A(\w+)/, 1] == plugin}.map do |a| + "#{a} => #{@aliases[a]}" + end.join ' | ' + end when 'create' _('"alias <text> => <command>" => add text as an alias of command. Text can contain placeholders marked with : or * for :words and *multiword arguments. The command can contain placeholders enclosed with < > which will be substituded with argument values. For example: alias googlerbot *terms => google site:linuxbrit.co.uk/rbot/ <terms>') when 'commands' |