code: public void commandLoop() throws IOException {
          for (Object handler : allHandlers) {
              if (handler instanceof ShellManageable) {
                  ((ShellManageable)handler).cliEnterLoop();
              }
          }
          output.output(appName, outputConverter);
          String command = "";
          while (true) {
              try {
                  command = input.readCommand(path);
                  if (command.trim().equals("exit")) {
                      if (lineProcessor == null)
                          break;
                      else {
                          path = savedPath;
                          lineProcessor = null;
                      }
                  }
  
                  processLine(command);
              } catch (TokenException te) {
                  lastException = te;
                  output.outputException(command, te);
              } catch (CLIException clie) {
                  lastException = clie;
                  if (!command.trim().equals("exit")) {
                      output.outputException(clie);
                  }
              }
          }
          for (Object handler : allHandlers) {
              if (handler instanceof ShellManageable) {
                  ((ShellManageable)handler).cliLeaveLoop();
              }
          }
      }
docs: Runs the command session.
  Create the Shell, then run this method to listen to the user,
  and the Shell will invoke Handler's methods.
  @throws java.io.IOException when can't readLine() from input.