mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-03 09:23:00 +00:00
raise error if preparation_command length is not equal to command or 1
Signed-off-by: Saurav Sharma <appdroiddeveloper@gmail.com>
This commit is contained in:
1 parent
0c0713da30
commit
bc82bd5f23
2 files changed
+12
-5
No files matched your search
@@ -236,11 +236,8 @@ pub fn run_benchmark(
|
||||
// Run init command
|
||||
let mut prepare_cmd = None;
|
||||
if let Some(values) = &options.preparation_command {
|
||||
if num >= values.len() {
|
||||
prepare_cmd = Some(new_command_from_get_parameter(
|
||||
cmd,
|
||||
&values[values.len() - 1],
|
||||
));
|
||||
if values.len() == 1 {
|
||||
prepare_cmd = Some(new_command_from_get_parameter(cmd, &values[0]));
|
||||
} else {
|
||||
prepare_cmd = Some(new_command_from_get_parameter(cmd, &values[num]));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user