// check if the syntax is correct
if (!logsearch_matcher.matches() ||
(logsearch_matcher.groupCount() < 1 &&
logsearch_matcher.groupCount() > 2))
{
bot.send(new Privmsg(nick, "Invalid syntax '"+command+" "+arguments+"'."));
return;
}
// get the different help arguments
String module_name = null;
String help_key = null;
module_name = logsearch_matcher.group(1);
if (logsearch_matcher.groupCount() > 1)
{
help_key = logsearch_matcher.group(2);
if (0 == help_key.length())
{
help_key = null;
}
}
// check if the module is known
module = (Module)modules.get(module_name);
if (null == module)
{
bot.send(new Privmsg(nick, "Unknown module '"+module_name+"'."));
return;
}
// obtain the requested help text
Map helpmap = module.getHelpMap();
if (null == helpmap ||
!helpmap.containsKey(help_key))
{
bot.send(new Privmsg(nick, "Couldn't find the requested help information in module '"+module_name+"'."));
return;
}
// output the help text
String help = (String)helpmap.get(help_key);