code: public void runCommands(final String[] commands) throws IOException {
  		doLines(0, new LineReader() {
  			private int commandC = 0;
  
  			@Override
  			public String getNextLine(String prompt) {
  				if (commandC >= commands.length) {
  					return null;
  				} else {
  					return commands[commandC++];
  				}
  			}
  		}, true);
  	}
docs: Run commands from the String array.