@@ -44,11 +44,7 @@ enum Commands {
4444 /// Run a command in each repository
4545 Run {
4646 /// Command to execute
47- #[ arg(
48- value_name = "COMMAND" ,
49- help = "Command to execute" ,
50- allow_hyphen_values = true
51- ) ]
47+ #[ arg( value_name = "COMMAND" , help = "Command to execute" ) ]
5248 command : Option < String > ,
5349
5450 /// Name of a recipe defined in config.yaml
@@ -266,31 +262,23 @@ async fn execute_builtin_command(command: Commands) -> Result<()> {
266262 repos : if repos. is_empty ( ) { None } else { Some ( repos) } ,
267263 } ;
268264
269- // Normalize command - treat empty strings as None
270- let command = command. filter ( |s| !s. trim ( ) . is_empty ( ) ) ;
271-
272265 // Validate that exactly one of command or recipe is provided
273- match ( command. as_ref ( ) , recipe. as_ref ( ) ) {
274- ( Some ( cmd) , None ) => {
275- RunCommand :: new_command ( cmd. clone ( ) , no_save, output_dir. map ( PathBuf :: from) )
276- . execute ( & context)
277- . await ?;
278- }
279- ( None , Some ( recipe_name) ) => {
280- RunCommand :: new_recipe (
281- recipe_name. clone ( ) ,
282- no_save,
283- output_dir. map ( PathBuf :: from) ,
284- )
266+ if command. is_none ( ) && recipe. is_none ( ) {
267+ anyhow:: bail!( "Either --recipe or a command must be provided" ) ;
268+ }
269+
270+ if command. is_some ( ) && recipe. is_some ( ) {
271+ anyhow:: bail!( "Cannot specify both command and --recipe" ) ;
272+ }
273+
274+ if let Some ( cmd) = command {
275+ RunCommand :: new_command ( cmd, no_save, output_dir. map ( PathBuf :: from) )
276+ . execute ( & context)
277+ . await ?;
278+ } else if let Some ( recipe_name) = recipe {
279+ RunCommand :: new_recipe ( recipe_name, no_save, output_dir. map ( PathBuf :: from) )
285280 . execute ( & context)
286281 . await ?;
287- }
288- ( None , None ) => {
289- anyhow:: bail!( "Either --recipe or a command must be provided" ) ;
290- }
291- ( Some ( _) , Some ( _) ) => {
292- anyhow:: bail!( "Cannot specify both command and --recipe" ) ;
293- }
294282 }
295283 }
296284 Commands :: Pr {
0 commit comments