Package jline

Examples of jline.ConsoleReader.readLine()


                    .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


      // ignore
    }

    while (!exit) {
      try {
        dispatch(reader.readLine(getPrompt()));
      } catch (EOFException eof) {
        // CTRL-D
        commands.quit(null);
      } catch (Throwable t) {
        handleException(t);
View Full Code Here

        }

        printBanner();

        String line;
        while ((line = reader.readLine(PROMPT + "> ")) != null)
        {
            processCLIStmt(line);
        }
    }
}
View Full Code Here

    public static String getPageUrlFromConsole() {
        try {
            final ConsoleReader reader = new ConsoleReader();
            System.out.print("Enter a website URL [" + DEFAULT_ROOT_URL + "]?: ");

            String line = reader.readLine();
            if (line.trim().length() == 0) {
                line = DEFAULT_ROOT_URL;
            }
            line = validateURL(line);
            if (null != line) {
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

                line = "";
                boolean submit = false;
                boolean newline = false;
                while (!submit) {
                    if (newline)
                        line = line + "\n" + reader.readLine(RexsterConsole.makeSpace(this.getPrompt().length()));
                    else
                        line = line + "\n" + reader.readLine(this.getPrompt());
                    if (line.endsWith(" .")) {
                        newline = true;
                        line = line.substring(0, line.length() - 2);
View Full Code Here

                boolean newline = false;
                while (!submit) {
                    if (newline)
                        line = line + "\n" + reader.readLine(RexsterConsole.makeSpace(this.getPrompt().length()));
                    else
                        line = line + "\n" + reader.readLine(this.getPrompt());
                    if (line.endsWith(" .")) {
                        newline = true;
                        line = line.substring(0, line.length() - 2);
                    } else {
                        line = line.trim();
View Full Code Here

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

            line = reader.readLine(prompt).trim();

            if (line.isEmpty())
                continue;

            currentStatement += line;
View Full Code Here

            Context cx = engine.getContextFactory().enterContext(null);
            cx.setErrorReporter(new ToolErrorReporter(false, System.err));
            String source = "";
            String prompt = getPrompt();
            while (true) {
                String newline = reader.readLine(prompt);
                if (newline == null) {
                    // NULL input, if e.g. Ctrl-D was pressed
                    out.println();
                    out.flush();
                    break repl;
View Full Code Here

    public static void main(String[] args) throws IOException
    {

        ConsoleReader reader = new ConsoleReader();

        String name = reader.readLine("Full Name> ");
        String email = reader.readLine("Email> ");
        String pubkey = reader.readLine("Public Key> ");
        String privkey = reader.readLine("Private Key> ");

        Map<String,String> properties = new HashMap<String, String>();
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.