Compact output, add -s color option, closes #70

Strip the empty lines within the results for each benchmark, but keep
the empty line between each benchmark, and before the summary.

Add `color` style option to show color but not be interactive (no
progress bar).
This commit is contained in:
Jason Peacock authored and David Peter committed 2018-09-28 21:57:53 +02:00
1 parent 4b8f47d6f2
commit 3246ec27e1
5 files changed
+14 -10

No files matched your search

+4 -2
View File
@@ -168,6 +168,7 @@ fn build_hyperfine_options(matches: &ArgMatches) -> Result<HyperfineOptions, Opt
Some("full") => OutputStyleOption::Full,
Some("basic") => OutputStyleOption::Basic,
Some("nocolor") => OutputStyleOption::NoColor,
Some("color") => OutputStyleOption::Color,
_ => {
if !options.show_output && atty::is(Stream::Stdout) {
OutputStyleOption::Full
@@ -182,8 +183,9 @@ fn build_hyperfine_options(matches: &ArgMatches) -> Result<HyperfineOptions, Opt
options.output_style = OutputStyleOption::NoColor;
}
if options.output_style != OutputStyleOption::Full {
colored::control::set_override(false);
match options.output_style {
OutputStyleOption::Full | OutputStyleOption::Color => colored::control::unset_override(),
_ => colored::control::set_override(false),
}
if matches.is_present("ignore-failure") {