| 428 | } |
| 429 | |
| 430 | ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color) { |
| 431 | int output_opts = ConsoleReporter::OO_Defaults; |
| 432 | auto is_benchmark_color = [force_no_color]() -> bool { |
| 433 | if (force_no_color) { |
| 434 | return false; |
| 435 | } |
| 436 | if (FLAGS_benchmark_color == "auto") { |
| 437 | return IsColorTerminal(); |
| 438 | } |
| 439 | return IsTruthyFlagValue(FLAGS_benchmark_color); |
| 440 | }; |
| 441 | if (is_benchmark_color()) { |
| 442 | output_opts |= ConsoleReporter::OO_Color; |
| 443 | } else { |
| 444 | output_opts &= ~ConsoleReporter::OO_Color; |
| 445 | } |
| 446 | if (FLAGS_benchmark_counters_tabular) { |
| 447 | output_opts |= ConsoleReporter::OO_Tabular; |
| 448 | } else { |
| 449 | output_opts &= ~ConsoleReporter::OO_Tabular; |
| 450 | } |
| 451 | return static_cast<ConsoleReporter::OutputOptions>(output_opts); |
| 452 | } |
| 453 | |
| 454 | } // end namespace internal |
| 455 | |