} catch (IndexOutOfBoundsException ioob) {
throw new IllegalArgumentException("command with id " + id + " not found in history");
}
}
ParsedLine parsedLine = new ParsedLine(line);
AbstractCommand cmd = getCommand(parsedLine.cmd);
if (cmd == null) {
exitCode = runShellCommand(line);
return exitCode;
}
if (historyList.size() > maxHistory) {
historyList.remove(0);
}
historyList.add(new HistoryElement(++historyIndex, line));
cmd.init(this);
cmd.run(parsedLine.args);
return cmd.getExitCode();
} catch (AbortException expected) {
exitCode = 0;
} catch (JGDIException ex) {
err.println(ex.getMessage());
logger.info("Command failed: " + ex.getMessage());