示例#1
0
  private void processInteractiveMode(ShellMethods curShell) {
    Scanner inputScanner = new Scanner(System.in);

    while (!Thread.currentThread().isInterrupted()) {
      System.out.print(curShell.getCurrentDirectory() + "$ ");

      String instructions = inputScanner.nextLine();

      try {
        doInstructions(instructions, curShell);
      } catch (IOException catchedException) {
        System.err.println(catchedException.getMessage());
      } catch (ShellInterruptionException catchedException) {
        return;
      }
    }
  }