diff --git a/pkg/cmd/repo/create/create.go b/pkg/cmd/repo/create/create.go index d43b30f24..fb37e27ed 100644 --- a/pkg/cmd/repo/create/create.go +++ b/pkg/cmd/repo/create/create.go @@ -75,10 +75,11 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co if !opts.IO.CanPrompt() { if opts.Name == "" { - return &cmdutil.FlagError{Err: errors.New("must pass name argument when not running interactively")} + return &cmdutil.FlagError{Err: errors.New("name argument required when not running interactively")} } + if !opts.Internal && !opts.Private && !opts.Public { - opts.Public = true + return &cmdutil.FlagError{Err: errors.New("--public, --private, or --internal required when not running interactively")} } }