Skip to content
Myr

Enable colors on Windows, closes #427

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by David Peter · parent 5c6b302 · Browse files · 1 file+4 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−5 removed

  • other:+4 added−5 removed

1 file+4 added−5 removed

modified:src/main.rs+4 added-5 removed
143 unmodified lines
144/// Build the HyperfineOptions that correspond to the given ArgMatches145fn build_hyperfine_options<'a>(146 matches: &ArgMatches<'a>,147) -> Result<HyperfineOptions, OptionsError<'a>> {148 // Enabled ANSI colors on Windows 10149 #[cfg(windows)]150 colored::control::set_virtual_terminal(true).unwrap();151152 let mut options = HyperfineOptions::default();153 let param_to_u64 = |param| {154 matches155 .value_of(param)
63 unmodified lines
219 }220 }221 };222219 // We default Windows to NoColor if full had been specified.220 if cfg!(windows) && options.output_style == OutputStyleOption::Full {221 options.output_style = OutputStyleOption::NoColor;222 }223223 match options.output_style {224 OutputStyleOption::Basic | OutputStyleOption::NoColor => {225 colored::control::set_override(false)226 }
232 unmodified lines