Package jline

Examples of jline.ConsoleReader.readLine()


        {
            prompt = (inCompoundStatement) ? "...\t" : getPrompt(cliClient);

            try
            {
                line = reader.readLine(prompt);
            }
            catch (IOException e)
            {
                // retry on I/O Exception
            }
View Full Code Here


    reader.setHistory(new History(new File(historyFile)));
    int ret = 0;

    String prefix = "";
    String curPrompt = prompt;
    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

            StringBuffer sb = new StringBuffer();
            reader.setBellEnabled(false);
            System.out.println("Type \"help\" at the console for more information");
            do {
              String prompt = (sb.length() > 0) ? "   " : "js>"; // no prompt if we're on a multiline
              String line = reader.readLine(prompt);
              if(line == null){
                // in eclipse jline doesn't work, so we have to resort standard System.in
                char c;
                do{
                  c = (char) System.in.read();
View Full Code Here

        DEFAULT_BELL_ENABLED));
    HelpManager help = new HelpManager();
    help.printVersion();
    StringBuilder queryStr = new StringBuilder();
    String extendedLine;
    while ((extendedLine = reader.readLine(getPrompt(queryStr))) != null) {
      if (isEndOfCommand(extendedLine)) {
        queryStr.append(" " + extendedLine);
        long start = System.currentTimeMillis();
        Parser parser = new Parser(queryStr.toString());
        ReturnMsg rs = null;
View Full Code Here

      boolean inCompoundStatement = false;

      while (line != null) {
        prompt = (inCompoundStatement) ? "...\t" : "playorm >>";

        line = reader.readLine(prompt);

        if (line == null)
          return;

        line = line.trim();
View Full Code Here

                .replace("$bind", bind)
                .replace("$port", Integer.toString(port))
                .replace("$name", NAME)
                .replace(OS_LINE_SEP, lineSep));

            while ((line = reader.readLine(prompt())) != null) {
                // exit simply let us go out of the loop
                // do we need a command for it?
                if (EXIT_COMMAND.equals(line)) {
                    break;
                }
View Full Code Here

    if (args.length == 0 || !args[0].equals(String.valueOf(Shell.RELAUNCH_FLAG))) {
      help.printVersion();
    }
    StringBuilder queryStr = new StringBuilder();
    String extendedLine;
    while ((extendedLine = reader.readLine(getPrompt(queryStr))) != null) {
      if (isEndOfCommand(extendedLine)) {
        queryStr.append(" " + extendedLine);
        long start = System.currentTimeMillis();

        HQLClient hql = new HQLClient(conf, MASTER_ADDRESS, out, tableFormater);
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

            /* prividing GNU readline features using Jline library */
            //String list = "list";
            PrintWriter out = new PrintWriter(System.out);
            reader.addCompletor(new ArgumentCompletor(
                    new SimpleCompletor(new String[]{"list", "info", "exit", "quit", "delete", "move", "view", "viewcontent", "queue", "exchange", "connection", "usermanagement", "virtualhost"})));
            while ((line = reader.readLine("qpid-admin-$ ")) != null) {
                out.flush();
                if (removeSpaces(line).equalsIgnoreCase("quit") || removeSpaces(line).equalsIgnoreCase("exit"))
                    break;
                else if (line.length() == 0)
                    continue;
View Full Code Here

                new JcrChildrenCompletor()
        }));
       
        while (!exit) {
            try {
                String input = reader.readLine("[" + this.getPrompt() + "] > ");
                if (input == null) {
                    input = "exit";
                } else {
                    input = input.trim();
                }
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.