1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-10 05:08:18 -05:00

Some code cleanup

This commit is contained in:
Sebastian Kaspari 2010-04-06 20:38:31 +02:00
parent 28d20d8499
commit a6c6ada378

View File

@ -18,16 +18,14 @@ import android.content.Intent;
* *
* @author Karol Gliniecki <karol.gliniecki@googlemail.com> * @author Karol Gliniecki <karol.gliniecki@googlemail.com>
*/ */
public class HelpHandler extends BaseHandler { public class HelpHandler extends BaseHandler
{
private String desc = "lists all available commands";
/** /**
* Execute /help * Execute /help
*/ */
@Override @Override
public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException { public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException
{
CommandParser cp = CommandParser.getInstance(); CommandParser cp = CommandParser.getInstance();
StringBuffer commandList = new StringBuffer("available commands: \n"); StringBuffer commandList = new StringBuffer("available commands: \n");
@ -40,13 +38,13 @@ public class HelpHandler extends BaseHandler {
for (Object command: commandKeys) { for (Object command: commandKeys) {
String alias = ""; String alias = "";
for (Object aliasCommand: aliasesKeys) { for (Object aliasCommand: aliasesKeys) {
System.out.println("alias: "+aliases.get(aliasCommand)); System.out.println("alias: " + aliases.get(aliasCommand));
if (command.equals(aliases.get(aliasCommand))) { if (command.equals(aliases.get(aliasCommand))) {
alias = " or /"+aliasCommand; alias = " or /" + aliasCommand;
break; break;
} }
} }
commandList.append("/"+command.toString() + alias+" - "+commands.get(command).getDescription()+"\n"); commandList.append("/" + command.toString() + alias + " - "+commands.get(command).getDescription() + "\n");
} }
Message message = new Message(commandList.toString()); Message message = new Message(commandList.toString());
@ -77,7 +75,6 @@ public class HelpHandler extends BaseHandler {
@Override @Override
public String getDescription() public String getDescription()
{ {
return desc; return "lists all available commands";
} }
} }