Ejemplo n.º 1
0
  public static void main(String args[]) throws IOException {
    // process command line args
    CliOptions cliOptions = new CliOptions();
    cliOptions.processArgs(css_, args);

    // connect to cassandra server if host argument specified.
    if (css_.hostName != null) {
      connect(css_.hostName, css_.thriftPort);
    } else {
      // If not, client must connect explicitly using the "connect" CLI statement.
      cliClient_ = new CliClient(css_, null);
    }

    ConsoleReader reader = new ConsoleReader();
    reader.setBellEnabled(false);

    String historyFile = System.getProperty("user.home") + File.separator + HISTORYFILE;

    reader.setHistory(new History(new File(historyFile)));

    printBanner();

    String line;
    while ((line = reader.readLine(PROMPT + "> ")) != null) {
      processLine(line);
    }
  }