/** * Resolves the first argument of a command line into either a unique identifier * * @param inputLine * @return */ protected Identifiable findItem(InputLine inputLine) { // first case is one in which this does not apply since there is no argument. if (inputLine.size() <= 1) { return null; } if (inputLine.getLastArg().startsWith("/")) { // then try to process this as a unique identifier. String arg = inputLine.getLastArg().substring(1); Identifier id = BasicIdentifier.newID(arg); return (Identifiable) getStore().get(id); } int choice = inputLine.getIntArg(inputLine.size() - 1); if (allEntries == null || allEntries.isEmpty()) { loadAllEntries(); // just in case... } return allEntries.get(choice); }