Beispiel #1
0
        public Reports CreateReports(bool verbose, bool quiet)
        {
            var useConsoleColor = _runtimeEnv.OperatingSystem == "Windows";

            IReport output = new Report(AnsiConsole.GetOutput(useConsoleColor));
            var reports = new Reports()
            {
                Information = output,
                Verbose = verbose ? output : Reports.Constants.NullReport,
                Error = new Report(AnsiConsole.GetError(useConsoleColor))
            };

            // If "--verbose" and "--quiet" are specified together, "--verbose" wins
            reports.Quiet = quiet ? reports.Verbose : output;

            return reports;
        }
Beispiel #2
0
 public static Reports CreateReports(bool verbose, bool quiet)
 {
     bool useConsoleColor = _runtimeEnv.OperatingSystem == "Windows";
     IReport report = new Report(AnsiConsole.GetOutput(useConsoleColor));
     Reports reports = new Reports
     {
         Information = report,
         Verbose = verbose ? report : Reports.Constants.NullReport,
         Error = new Report(AnsiConsole.GetError(useConsoleColor))
     };
     reports.Quiet = (quiet ? reports.Verbose : report);
     return reports;
 }