// AddResourceType adds a flag for ACL resource type and registers completion options
AddResourceType adds a flag for ACL resource type and registers completion options
// AddResourceType adds a flag for ACL resource type and registers completion options
func (fs *flagSet) AddResourceType(resourceType *string) *flagutil.FlagOptions {
	flagName := "resource-type"
	resourceTypeFilterMap := aclcmdutil.GetResourceTypeFilterMap()
	resourceTypes := make([]string, 0, len(resourceTypeFilterMap))
	for i := range resourceTypeFilterMap {
		resourceTypes = append(resourceTypes, i)
	}
	fs.StringVar(
		resourceType,
		flagName,
		aclcmdutil.ResourceTypeANY,
		flagutil.FlagDescription(fs.factory.Localizer, "kafka.acl.common.flag.resourceType", resourceTypes...),
	)
	_ = fs.cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
		return resourceTypes, cobra.ShellCompDirectiveNoSpace
	})
	return flagutil.WithFlagOptions(fs.cmd, flagName)
}
func ( fs * flagSet ) AddResourceType ( resourceType * string ) * flagutil . FlagOptions { flagName := " " resourceTypeFilterMap := aclcmdutil . GetResourceTypeFilterMap ( ) resourceTypes := make ( [ ] string , 0 , len ( resourceTypeFilterMap ) ) for i := range resourceTypeFilterMap { resourceTypes = append ( resourceTypes , i ) } fs . StringVar ( resourceType , flagName , aclcmdutil . ResourceTypeANY , flagutil . FlagDescription ( fs . factory . Localizer , " " , resourceTypes ... ) , ) _ = fs . cmd . RegisterFlagCompletionFunc ( flagName , func ( cmd * cobra . Command , args [ ] string , toComplete string ) ( [ ] string , cobra . ShellCompDirective ) { return resourceTypes , cobra . ShellCompDirectiveNoSpace } ) return flagutil . WithFlagOptions ( fs . cmd , flagName ) }
AddResourceType adds a flag for ACL resource type and registers completion options
AddResourceType adds a flag for ACL resource type and registers completion options