File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ enum Commands {
4848 command : Option < String > ,
4949
5050 /// Name of a recipe defined in config.yaml
51- #[ arg( long, conflicts_with = "command" ) ]
51+ #[ arg( long) ]
5252 recipe : Option < String > ,
5353
5454 /// Specific repository names to run command in (if not provided, uses tag filter or all repos)
Original file line number Diff line number Diff line change @@ -52,6 +52,28 @@ fn test_run_command_missing_command_and_recipe() {
5252 assert ! ( stderr. contains( "Either --recipe or a command must be provided" ) ) ;
5353}
5454
55+ #[ test]
56+ fn test_run_command_both_command_and_recipe ( ) {
57+ let output = Command :: new ( "cargo" )
58+ . args ( [
59+ "run" ,
60+ "--" ,
61+ "run" ,
62+ "--recipe" ,
63+ "test-recipe" ,
64+ "echo hello" ,
65+ "--config" ,
66+ "tests/test-recipes.yaml" ,
67+ ] )
68+ . output ( )
69+ . expect ( "Failed to execute cargo run" ) ;
70+
71+ assert ! ( !output. status. success( ) ) ;
72+ let stderr = String :: from_utf8_lossy ( & output. stderr ) ;
73+ // Should fail because both command and recipe are provided
74+ assert ! ( stderr. contains( "Cannot specify both command and --recipe" ) ) ;
75+ }
76+
5577#[ test]
5678fn test_pr_command_missing_required_args ( ) {
5779 let output = Command :: new ( "cargo" )
You can’t perform that action at this time.
0 commit comments