code: void progress(int cur, int max) {
      StringBuilder out = new StringBuilder();
  
      if (lastProgress != null) {
        char[] back = new char[lastProgress.length()];
        Arrays.fill(back, '\b');
        out.append(back);
      }
  
      String progress =
          cur + "/" + (max == -1 ? "?" : "" + max) + " "
              + (max == -1 ? "(??%)"
              : "(" + cur * 100 / (max == 0 ? 1 : max) + "%)");
  
      if (cur >= max && max != -1) {
        progress += " " + loc("done") + SEPARATOR;
        lastProgress = null;
      } else {
        lastProgress = progress;
      }
  
      out.append(progress);
  
      getOutputStream().print(out.toString());
      getOutputStream().flush();
    }
docs: Output a progress indicator to the console.
  
  @param cur the current progress
  @param max the maximum progress, or -1 if unknown