diff --git a/src/command.rs b/src/command.rs index 732e223..5523f92 100644 --- a/src/command.rs +++ b/src/command.rs @@ -209,7 +209,7 @@ impl<'a> Commands<'a> { self.0.iter() } - pub fn len(&self) -> usize { + pub fn num_commands(&self) -> usize { self.0.len() } diff --git a/src/options.rs b/src/options.rs index 489470f..46e79d5 100644 --- a/src/options.rs +++ b/src/options.rs @@ -22,6 +22,7 @@ pub const DEFAULT_SHELL: &str = "cmd.exe"; pub enum Shell { /// Default shell command Default(&'static str), + /// Custom shell command specified via --shell Custom(Vec), } @@ -264,7 +265,8 @@ impl Options { pub fn validate_against_command_list(&self, commands: &Commands) -> Result<()> { if let Some(preparation_command) = &self.preparation_command { ensure!( - preparation_command.len() <= 1 || commands.len() == preparation_command.len(), + preparation_command.len() <= 1 + || commands.num_commands() == preparation_command.len(), "The '--prepare' option has to be provided just once or N times, where N is the \ number of benchmark commands." );