end
def help(plugin, topic='')
- _("define <phrase> [from <database>] => Show definition of a phrase; match <phrase> [using <strategy>] [from <database>] => Show matching phrases; dictclient databases => List databases; dictclient strategies => List strategies")
+ case topic
+ when 'define'
+ _('define <phrase> [from <database>] => Show definition of a phrase')
+ when 'match'
+ _('match <phrase> [using <strategy>] [from <database>] => Show phrases matching the given pattern')
+ when 'server information'
+ _('dictclient databases => List databases; dictclient strategies => List strategies')
+ else
+ _('look up phrases on the configured DICT server. topics: define, match, server information')
+ end
end
end
plugin.map 'define *phrase [from :database]',
:action => 'cmd_define',
- :defaults => {:database => DICT::ALL_DATABASES}
+ :defaults => {:database => DICT::ALL_DATABASES},
+ :threaded => true
plugin.map 'match *phrase [using :strategy] [from :database]',
:action => 'cmd_match',
:defaults => {:database => DICT::ALL_DATABASES,
- :strategy => DICT::DEFAULT_MATCH_STRATEGY }
+ :strategy => DICT::DEFAULT_MATCH_STRATEGY },
+ :threaded => true
-plugin.map 'dictclient databases', :action => 'cmd_databases'
-plugin.map 'dictclient strategies', :action => 'cmd_strategies'
+plugin.map 'dictclient databases', :action => 'cmd_databases', :thread => true
+plugin.map 'dictclient strategies', :action => 'cmd_strategies', :thread => true