From f6b61c2dc7903452db539ba5c7d40e3137b2612a Mon Sep 17 00:00:00 2001 From: Enda Phelan Date: Fri, 24 Sep 2021 15:36:09 +0100 Subject: [PATCH] fix: set --role flag as required --- pkg/cmd/registry/artifact/role/add/add.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cmd/registry/artifact/role/add/add.go b/pkg/cmd/registry/artifact/role/add/add.go index 839080941..c475f25a3 100644 --- a/pkg/cmd/registry/artifact/role/add/add.go +++ b/pkg/cmd/registry/artifact/role/add/add.go @@ -99,6 +99,7 @@ func NewAddCommand(f *factory.Factory) *cobra.Command { cmd.Flags().StringVar(&opts.role, "role", "", opts.localizer.MustLocalize("registry.role.cmd.flag.role.description")) cmd.Flags().StringVar(&opts.registryID, "instance-id", "", opts.localizer.MustLocalize("artifact.common.instance.id")) + _ = cmd.MarkFlagRequired("role") _ = cmd.RegisterFlagCompletionFunc("role", func(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return util.AllowedRoleTypeEnumValues, cobra.ShellCompDirectiveNoSpace })