diff --git a/pkg/cmd/agent-task/create/create.go b/pkg/cmd/agent-task/create/create.go index b7667dcf5..df0b14658 100644 --- a/pkg/cmd/agent-task/create/create.go +++ b/pkg/cmd/agent-task/create/create.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "io" - "strings" "time" "github.com/cenkalti/backoff/v4" @@ -35,9 +34,15 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co cmd := &cobra.Command{ Use: "create ", Short: "Create an agent task (preview)", - Args: cobra.MinimumNArgs(1), + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - opts.ProblemStatement = strings.Join(args, " ") + // TODO: We'll support prompting for the problem statement if not provided + // and from file flags, later. + if len(args) == 0 { + return cmdutil.FlagErrorf("a problem statement is required") + } + + opts.ProblemStatement = args[0] // Support -R/--repo override if f != nil { opts.BaseRepo = f.BaseRepo