Skip to content

Commit

Permalink
fix: benchy: print help if no command is given (#1527)
Browse files Browse the repository at this point in the history
Prior to this change benchy will panic if there were no options given.
Now it prints the help.
  • Loading branch information
vmx authored Oct 15, 2021
1 parent fd769f0 commit 2065052
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fil-proofs-tooling/src/bin/benchy/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::str::FromStr;

use anyhow::Result;
use byte_unit::Byte;
use clap::{value_t, App, Arg, SubCommand};
use clap::{value_t, App, AppSettings, Arg, SubCommand};

use storage_proofs_core::api_version::ApiVersion;

Expand Down Expand Up @@ -171,6 +171,7 @@ fn main() -> Result<()> {
);

let matches = App::new("benchy")
.setting(AppSettings::ArgRequiredElseHelp)
.version("0.1")
.subcommand(window_post_cmd)
.subcommand(winning_post_cmd)
Expand Down Expand Up @@ -240,7 +241,7 @@ fn main() -> Result<()> {
serde_json::to_writer(stdout(), &outputs)
.expect("failed to write ProdbenchOutput to stdout")
}
_ => panic!("carnation"),
_ => unreachable!(),
}

Ok(())
Expand Down

0 comments on commit 2065052

Please sign in to comment.