code: public static PrintStream getOutputStream() {
  
          CmsShell shell = CmsShell.getTopShell();
          if (shell != null) {
              return shell.getOut();
          } else {
              return System.out;
          }
  
      }
docs: Retrieves the appropriate output stream to write the report to.<p>
  
  If we are running in a shell context, this will return the shell's assigned output stream, otherwise System.out is returned.<p>
  
  @return the output stream to write the report to