mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Added 'none' as a possible value for "style" option
This commit allows to remove all non-errornous output of the tool.
This commit is contained in:
1 parent
6a8dd1962c
commit
5bdfdbf1cb
4 files changed
+72
-49
No files matched your search
+4
-2
@@ -55,6 +55,7 @@ fn main() {
|
||||
let options = build_hyperfine_options(&matches);
|
||||
let export_manager = build_export_manager(&matches);
|
||||
let commands = build_commands(&matches);
|
||||
let unwrapped_opts = options.unwrap();
|
||||
|
||||
let res = match options {
|
||||
Ok(ref opts) => run(&commands, &opts),
|
||||
@@ -63,8 +64,8 @@ fn main() {
|
||||
|
||||
match res {
|
||||
Ok(timing_results) => {
|
||||
write_benchmark_comparison(&timing_results);
|
||||
let ans = export_manager.write_results(timing_results, options.unwrap().time_unit);
|
||||
if unwrapped_opts.output_style != OutputStyleOption::None { write_benchmark_comparison(&timing_results); }
|
||||
let ans = export_manager.write_results(timing_results, unwrapped_opts.time_unit);
|
||||
if let Err(e) = ans {
|
||||
error(&format!(
|
||||
"The following error occurred while exporting: {}",
|
||||
@@ -135,6 +136,7 @@ fn build_hyperfine_options(matches: &ArgMatches<'_>) -> Result<HyperfineOptions,
|
||||
Some("basic") => OutputStyleOption::Basic,
|
||||
Some("nocolor") => OutputStyleOption::NoColor,
|
||||
Some("color") => OutputStyleOption::Color,
|
||||
Some("none") => OutputStyleOption::None,
|
||||
_ => {
|
||||
if !options.show_output && atty::is(Stream::Stdout) {
|
||||
OutputStyleOption::Full
|
||||
|
||||
Reference in new issue
Block a user