Skip to content

Commit

Permalink
chore: make recipe path arg optional in test command
Browse files Browse the repository at this point in the history
  • Loading branch information
majori committed Jun 13, 2024
1 parent fa58ba4 commit ac85639
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/cli/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ type testOptions struct {
func NewTestCmd() *cobra.Command {
var opts testOptions
var cmd = &cobra.Command{
Use: "test RECIPE_PATH",
Use: "test [RECIPE_PATH]",
Short: "Run tests for the recipe",
Long: "Run tests for the recipe.",
Args: cobra.ExactArgs(1),
Args: cobra.MaximumNArgs(1),
PreRunE: func(cmd *cobra.Command, args []string) error {
opts.RecipePath = args[0]
if len(args) == 1 {
opts.RecipePath = args[0]
} else {
opts.RecipePath = "."
}
return option.Parse(&opts)
},
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit ac85639

Please sign in to comment.