Clean up help text

This commit is contained in:
sharkdp committed 2018-01-16 21:36:41 +01:00
1 parent f29bbb58eb
commit b6ca2d6ac2
1 file changed
+17 -15
+17 -15
View File
@@ -42,6 +42,8 @@ fn main() {
.version(crate_version!())
.setting(AppSettings::ColoredHelp)
.setting(AppSettings::DeriveDisplayOrder)
.setting(AppSettings::UnifiedHelpMessage)
.max_term_width(90)
.about("A command-line benchmarking tool")
.arg(
Arg::with_name("command")
@@ -56,17 +58,6 @@ fn main() {
.short("i")
.help("Ignore non-zero exit codes"),
)
.arg(
Arg::with_name("setup")
.long("setup")
.short("S")
.takes_value(true)
.value_name("CMD")
.help(
"Execute CMD before each benchmark run. This is useful for \
clearing disk caches, for example.",
),
)
.arg(
Arg::with_name("warmup")
.long("warmup")
@@ -75,7 +66,7 @@ fn main() {
.value_name("NUM")
.help(
"Perform NUM warmup runs before the actual benchmark. This can be used \
to fill (disk) caches for I/O-heavy programs.",
to fill (disk) caches for I/O-heavy programs",
),
)
.arg(
@@ -85,16 +76,25 @@ fn main() {
.takes_value(true)
.value_name("NUM")
.help(&format!(
"Perform at least NUM runs for each command (default: {}).",
"Perform at least NUM runs for each command (default: {})",
options.min_runs
)),
)
.arg(
Arg::with_name("setup")
.long("setup")
.short("S")
.takes_value(true)
.value_name("CMD")
.help(
"Execute CMD before each benchmark run. This is useful for \
clearing disk caches, for example",
),
)
.get_matches();
options.ignore_failure = matches.is_present("ignore-failure");
options.setup_command = matches.value_of("setup").map(String::from);
let str_to_u64 = |n| u64::from_str_radix(n, 10).ok();
options.warmup_count = matches
@@ -107,6 +107,8 @@ fn main() {
options.min_runs = cmp::max(2, min_runs);
}
options.setup_command = matches.value_of("setup").map(String::from);
let commands = matches.values_of("command").unwrap().collect();
let res = run(&commands, &options);