}
public boolean executePromptCommand(String[] args) throws Exception {
String cmd = args[0];
if (commands.containsKey(cmd)) {
ClientCommand command = commands.get(cmd);
if (shouldDisplayHelp(args)) {
outputWriter.println("Usage: " + command.getSyntax());
outputWriter.println(command.getDetailedHelp());
return true;
}
try {
boolean response = command.execute(this, args);
processNotes(outputWriter);
outputWriter.println("");
return response;
} catch (CommandLineParseException e) {
outputWriter.println(command.getPromptCommandString() + ": " + e.getMessage());
outputWriter.println("Usage: " + command.getSyntax());
} catch (ArrayIndexOutOfBoundsException e) {
outputWriter.println(command.getPromptCommandString()
+ ": An incorrect number of arguments was specified.");
outputWriter.println("Usage: " + command.getSyntax());
}
} else {
boolean result = commands.get("exec").execute(this, args);
if (loggedIn()) {
this.codeCompletion.setScriptContext(getScriptEngine().getContext());