Package jline

Examples of jline.ConsoleReader.readLine()


    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';
      }
View Full Code Here


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

            line = reader.readLine(prompt);

            if (line == null)
                return;

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

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

            try
            {
                line = reader.readLine(prompt);
            }
            catch (IOException e)
            {
                // retry on I/O Exception
            }
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

        final ConsoleReader reader = new ConsoleReader(System.in, new OutputStreamWriter(System.out));
        reader.addCompletor(new FileNameCompletor());
        reader.addCompletor(new SimpleCompletor(CommandManager.keys().toArray(new String[CommandManager.size()])));

        String line;
        while ((line = reader.readLine(PROMPT)) != null) {
            if (EXIT_CMD.equals(line)) {
                break;
            }

            Class<?> cmdClass = null;
View Full Code Here

    }

    while (!exit) {
      try {
        // Execute one instruction; terminate on executing a script if there is an error
        if (!dispatch(reader.readLine(getPrompt())) && runningScript) {
          commands.quit(null);
          status = ERRNO_OTHER;
        }
      } catch (EOFException eof) {
        // CTRL-D
View Full Code Here

        final ConsoleReader reader = new ConsoleReader(System.in, new OutputStreamWriter(System.out));
        reader.addCompletor(new FileNameCompletor());
        reader.addCompletor(new SimpleCompletor(CommandManager.keys().toArray(new String[CommandManager.size()])));

        String line;
        while ((line = reader.readLine(PROMPT)) != null) {
            if (EXIT_CMD.equals(line)) {
                break;
            }

            Class<?> cmdClass = null;
View Full Code Here

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

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

        }

        printBanner();

        String line;
        while ((line = reader.readLine(PROMPT + "> ")) != null)
        {
            processCLIStmt(line);
        }
    }
}
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

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.