Package jline

Examples of jline.ConsoleReader.readLine()


        prompts.put(Boolean.FALSE, "HBql> ");
        prompts.put(Boolean.TRUE, "> ");

        while (true) {

            final String line = reader.readLine(prompts.get(continuation));

            if (line == null || line.toLowerCase().startsWith("quit") || line.toLowerCase().startsWith("exit"))
                break;

            if (Utils.isValidString(line)) {
View Full Code Here


      } else {
        instance = HdfsZooInstance.getInstance();
      }
     
      if (passw == null)
        passw = reader.readLine("Enter current password for '" + user + "'@'" + instance.getInstanceName() + "': ", '*');
      if (passw == null) {
        reader.printNewline();
        return;
      } // user canceled
     
View Full Code Here

            System.exit(0);
        }
       
        ConsoleReader reader = new ConsoleReader();
        String line;
        while ((line = reader.readLine("[cassandra-stress] ")) != null) {
            if ( line.equalsIgnoreCase("exit")) {
                System.exit(0);
            }
            stress.processCommand(reader, line);
        }
View Full Code Here

    String prefix = "";
    String curDB = getFormattedDb(conf, ss);
    String curPrompt = prompt + curDB;
    String dbSpaces = spacesForString(curDB);

    while ((line = reader.readLine(curPrompt + "> ")) != null) {
      if (!prefix.equals("")) {
        prefix += '\n';
      }
      if (line.trim().endsWith(";") && !line.trim().endsWith("\\;")) {
        line = prefix + line;
View Full Code Here

          SCUIFeature.set("DEFAULT_BAUD", temp.trim());
        }
      } while (!readNext);

      do {
        temp = console.readLine(String.format("Data Bits (%s): ", SCUIFeature.get("DEFAULT_DATABITS")));
        if (temp.trim().isEmpty()) {
          readNext = true;
        } else if (!temp.matches("[0-9]+")) {
          System.out.println("Input must be numbers");
          readNext = false;
View Full Code Here

          SCUIFeature.set("DEFAULT_DATABITS", temp.trim());
        }
      } while (!readNext);

      do {
        temp = console.readLine(String.format("Stop Bits (%s): ", SCUIFeature.get("DEFAULT_STOPBITS")));
        if (temp.trim().isEmpty()) {
          readNext = true;
        } else if (!temp.matches("[0-9]+")) {
          System.out.println("Input must be numbers");
          readNext = false;
View Full Code Here

          SCUIFeature.set("DEFAULT_STOPBITS", temp.trim());
        }
      } while (!readNext);

      do {
        temp = console.readLine(String.format("Parity (%s): ", SCUIFeature.get("DEFAULT_PARITY")));
        if (temp.trim().isEmpty()) {
          readNext = true;
        } else if (!temp.matches("[0-9]+")) {
          System.out.println("Input must be numbers");
          readNext = false;
View Full Code Here

          SCUIFeature.set("DEFAULT_PARITY", temp.trim());
        }
      } while (!readNext);

      do {
        temp = console.readLine(String.format("Start Character (%s): ", SCUIFeature.get("DEFAULT_STARTCHARACTER")));
        if (temp.trim().isEmpty()) {
          readNext = true;
        } else if (!temp.matches("[0-9]+")) {
          System.out.println("Input must be numbers");
          readNext = false;
View Full Code Here

          SCUIFeature.set("DEFAULT_STARTCHARACTER", temp.trim());
        }
      } while (!readNext);

      do {
        temp = console.readLine(String.format("End Character (%s): ", SCUIFeature.get("DEFAULT_ENDCHARACTER")));
        if (temp.trim().isEmpty()) {
          readNext = true;
        } else if (!temp.matches("[0-9]+")) {
          System.out.println("Input must be numbers");
          readNext = false;
View Full Code Here

          SCUIFeature.set("DEFAULT_ENDCHARACTER", temp.trim());
        }
      } while (!readNext);

      do {
        temp = console.readLine(String.format("Byte Count (%s): ", SCUIFeature.get("DEFAULT_BYTECOUNT")));
        if (temp.trim().isEmpty()) {
          readNext = true;
        } else if (!temp.matches("[0-9]+")) {
          System.out.println("Input must be numbers");
          readNext = false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.