Skip to content
Myr

Modify clap settings

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

authored by sharkdp · committed by sharkdp · parent 39ee0f8 · Browse files · 2 files+8 added−10 removed
This commit

State

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

Diff stats

2 files+8 added−10 removed

  • other:+8 added−10 removed

2 files+8 added−10 removed

modified:src/main.rs+8 added-9 removed
1extern crate ansi_term;2#[macro_use]3extern crate clap;4extern crate indicatif;56use std::process::{Command, Stdio};
60 unmodified lines
6768 let mut results = vec![];6970 // Warmup phase70 if let Some(warmup_count) = options.warmup_count71 {71 if let Some(warmup_count) = options.warmup_count {72 let bar = get_progress_bar(warmup_count, "Performing warmup runs");7374 for _ in 1..warmup_count {75 bar.inc(1);
65 unmodified lines
141 fn default() -> HyperfineOptions {142 HyperfineOptions {143 warmup_count: None,144 min_runs: 10,145 min_time_sec: 5.0145 min_time_sec: 5.0,146 }147 }148}149150fn main() {151 let matches = App::new("hyperfine")152 .global_settings(&[AppSettings::ColoredHelp])153 .version("0.1")152 .version(crate_version!())153 .setting(AppSettings::ColoredHelp)154 .setting(AppSettings::DeriveDisplayOrder)155 .about("A command-line benchmarking tool")155 .author("David Peter <mail@david-peter.de>")156 .arg(157 Arg::with_name("command")158 .help("Command to benchmark")159 .required(true)
8 unmodified lines
168 .help("Perform NUM warmup runs before the actual benchmark"),169 )170 .get_matches();171172172 let mut options = HyperfineOptions::default();174 options.warmup_count =175 matches.value_of("warmup")173 options.warmup_count = matches174 .value_of("warmup")175 .and_then(|n| u64::from_str_radix(n, 10).ok());176177 let commands = matches.values_of("command").unwrap();178 for cmd in commands {
3 unmodified lines
modified:Cargo.toml-1 removed