From a811e72c9d1073e45e0c7ecbe371cf11bf3b7ec7 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Fri, 11 Sep 2020 11:57:40 -0500 Subject: [PATCH] do not assume public when creating repo non-interactively --- pkg/cmd/repo/create/create.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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")} } }