Esempio n. 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 : new NullReport(),
                Error = new Report(AnsiConsole.GetError(useConsoleColor)),
            };

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

            return reports;
        }
Esempio n. 2
0
        private Reports CreateReports(bool verbose, bool quiet)
        {
            IReport output = new Report(AnsiConsole.Output);
            var reports = new Reports()
            {
                Information = output,
                Verbose = verbose ? output : new NullReport(),
                Error = new Report(AnsiConsole.Output),
            };

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

            return reports;
        }