Add multiple --prepare support

Signed-off-by: Saurav Sharma <appdroiddeveloper@gmail.com>
This commit is contained in:
Saurav Sharma authored and David Peter committed 2019-10-13 15:11:39 +02:00
1 parent 2c3ced9333
commit 0c0713da30
5 files changed
+36 -12

No files matched your search

+5 -1
View File
@@ -113,7 +113,11 @@ fn build_hyperfine_options(matches: &ArgMatches<'_>) -> Result<HyperfineOptions,
(None, None) => {}
};
options.preparation_command = matches.value_of("prepare").map(String::from);
if let Some(values) = matches.values_of("prepare") {
options.preparation_command = Some(values.map(String::from).collect::<Vec<String>>());
} else {
options.preparation_command = None;
}
options.cleanup_command = matches.value_of("cleanup").map(String::from);