Skip to content
Myr

Use ASCII spinner for Windows

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

closes #229

authored by sharkdp · committed by David Peter · parent 8b0dd37 · Browse files · 1 file+8 added−2 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+8 added−2 removed

  • other:+8 added−2 removed

1 file+8 added−2 removed

modified:src/hyperfine/internal.rs+8 added-2 removed
8 unmodified lines
910/// Threshold for warning about fast execution time11pub const MIN_EXECUTION_TIME: Second = 5e-3;1213#[cfg(not(windows))]14const TICK_SETTINGS: (&str, u64) = ("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏ ", 80);1516#[cfg(windows)]17const TICK_SETTINGS: (&str, u64) = (r"+-x| ", 200);1819/// Return a pre-configured progress bar20pub fn get_progress_bar(length: u64, msg: &str, option: OutputStyleOption) -> ProgressBar {21 let progressbar_style = match option {22 OutputStyleOption::Basic | OutputStyleOption::Color => ProgressStyle::default_bar(),23 _ => ProgressStyle::default_spinner()18 .tick_chars("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏")24 .tick_chars(TICK_SETTINGS.0)25 .template(" {spinner} {msg:<30} {wide_bar} ETA {eta_precise}"),26 };2728 let progress_bar = match option {29 OutputStyleOption::Basic | OutputStyleOption::Color => ProgressBar::hidden(),30 _ => ProgressBar::new(length),31 };32 progress_bar.set_style(progressbar_style.clone());27 progress_bar.enable_steady_tick(80);33 progress_bar.enable_steady_tick(TICK_SETTINGS.1);34 progress_bar.set_message(msg);3536 progress_bar37}
180 unmodified lines