Package jline.console

Examples of jline.console.ConsoleReader.readLine()


    out.println(banner());

    Environment env = new Environment();

    while (!env.isHalted()) {
      String line = reader.readLine();
      if (line == null)
        break;

      String output = eval(env, line);
View Full Code Here


      // Used to build up multiline statement blocks (like functions)
      StringBuilder block = null;
      //noinspection InfiniteLoopStatement
      do {
        String prompt = (block != null) ? "|    " : ">> ";
        String rawLine = reader.readLine(prompt);

        if (inFunction) {
          if (rawLine == null || rawLine.trim().isEmpty()) {
            inFunction = false;
View Full Code Here

        reader.setCompletionHandler(new ShowDiffsOnlyCompletionHandler());

        String line;
        try {
          while ((line = reader.readLine()) != null) {
            line = line.trim();
            // ignore empty lines and comments
            if (line.length() == 0 || line.startsWith("#")) {
              continue;
            }
View Full Code Here

    private boolean confirm(CommandSession session) throws IOException {
        for (;;) {
            ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
            String msg = "You are about to perform a start/stop/refresh load test on bundles.\nDo you wish to continue (yes/no): ";
            String str = reader.readLine(msg);
            if ("yes".equalsIgnoreCase(str)) {
                return true;
            }
            if ("no".equalsIgnoreCase(str)) {
                return false;
View Full Code Here

        }
        else if ((level < 50) && (bsl.getStartLevel() > 50) && !force){
            for (;;) {
                ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
                String msg = "You are about to designate bundle as a system bundle.  Do you wish to continue (yes/no): ";
                String str = reader.readLine(msg);
                if ("yes".equalsIgnoreCase(str)) {
                    bsl.setStartLevel(level);
                    break;
                } else if ("no".equalsIgnoreCase(str)) {
                    break;
View Full Code Here

        return readLine(msg, null);
    }

    public String readLine(String msg, Character mask) throws IOException {
        ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
        return reader.readLine(msg, mask);
    }

}
View Full Code Here

                msg = String.format("Confirm: reboot instance %s (yes/no): ", karafName);
            } else {
                msg = String.format("Confirm: halt instance %s (yes/no): ", karafName);
            }
            ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
            String str = reader.readLine(msg);
            if (str.equalsIgnoreCase("yes")) {
                if (reboot) {
                    systemService.reboot(time, determineSwipeType());
                } else {
                    systemService.halt(time);
View Full Code Here

     */
    public static boolean accessToSystemBundleIsAllowed(long bundleId, CommandSession session) throws IOException {
        for (; ; ) {
            ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
            String msg = "You are about to access system bundle " + bundleId + ".  Do you wish to continue (yes/no): ";
            String str = reader.readLine(msg);
            if ("yes".equalsIgnoreCase(str)) {
                return true;
            }
            if ("no".equalsIgnoreCase(str)) {
                return false;
View Full Code Here

        return readLine(msg, null);
    }

    public String readLine(String msg, Character mask) throws IOException {
        ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
        return reader.readLine(msg, mask);
    }

}
View Full Code Here

    private boolean confirm(CommandSession session) throws IOException {
        for (;;) {
            ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
            String msg = "You are about to perform a start/stop/refresh load test on bundles.\nDo you wish to continue (yes/no): ";
            String str = reader.readLine(msg);
            if ("yes".equalsIgnoreCase(str)) {
                return true;
            }
            if ("no".equalsIgnoreCase(str)) {
                return 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.