Package jline

Examples of jline.ConsoleReader.readLine()


                new JcrChildrenCompletor()
        }));
       
        while (!exit) {
            try {
                String input = reader.readLine("[" + this.getPrompt() + "] > ");
               
                log.debug("running: " + input);
                if (input.trim().equals("exit") || input.trim().equals("quit")) { // exit?
                    exit = true;
                    System.out.println("Good bye...");
View Full Code Here


            // allows caller to customize completor
            if(completor != null)
                reader.addCompletor(completor);
            do {
                idleMonitor.setIdle();
                String line = reader.readLine(commandPrompt + "> ").trim();
                // does not dispatch commands for caller, notify caller for processing commands
                if(cmdListener != null) {
                    idleMonitor.setBusy();
                    logCommand(line);
                    cmdListener.processCommand(line);
View Full Code Here

            reader.addCompletor(completor);

            idleMonitor.start();
            do {
                idleMonitor.setIdle();
                String line = reader.readLine(commandPrompt + "> ").trim();
                StringTokenizer tok = new StringTokenizer(line);
                if(tok.hasMoreElements()) {
                    String cmd = tok.nextToken();
                    // dispatches commands based on commandTable
                    if(commandTable.containsKey(cmd)) {
View Full Code Here

        System.out.println("REPL (experimental)");
        System.out.println("-------------------");
        System.out.println("Type 'bye' to exit\n");

        while(true) {
            input = console.readLine();
            if(input.equals("bye"))  break;

            try {
                message = Message.parse(input, "<eval>");
                if(debug) System.out.println("debug >> " + message.fullName());
View Full Code Here

    mCmdBuilder = new StringBuilder();

    try {
      while (true) {
        printPrompt();
        String line = conReader.readLine();
        if (null == line) {
          // EOF on input. We're done.
          throw new QuitException(0);
        } else if (line.endsWith("\\c")) {
          // Lines ending in '\\c' cancel the current input.
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

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

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

    private String readPassword(String prompt) {
        ConsoleReader reader;
        try {
            reader = new ConsoleReader();
            Character mask = 0;
            return reader.readLine(prompt, mask);
        } catch (IOException ignored) {
        }
        return null;
    }
}
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

    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

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.