public void batchMode(String[] args, PrintStream err) { String commandLine = StringUtils.join(Arrays.asList(args), " "); try { table.executeCommandLine(commandLine); } catch (IOException ioe) { err.println(ioe.getMessage()); System.exit(1); } }
public void interactiveMode(InputStream in, PrintStream ps, PrintStream err) { Scanner scanner = new Scanner(in); ps.print("$ "); while (scanner.hasNext()) { try { table.executeCommandLine(scanner.nextLine()); } catch (IOException ioe) { err.println(ioe.getMessage()); } ps.print("$ "); } }