// AddOperationFilter adds a flag for ACL operations filter and registers completion options
AddOperationFilter adds a flag for ACL operations filter and registers completion options
// AddOperationFilter adds a flag for ACL operations filter and registers completion options
func (fs *flagSet) AddOperationFilter(operationType *string) *flagutil.FlagOptions {
	flagName := "operation"
	operationFilterMap := aclcmdutil.GetOperationFilterMap()
	operations := make([]string, 0, len(operationFilterMap))
	for i := range operationFilterMap {
		operations = append(operations, i)
	}
	fs.StringVar(
		operationType,
		flagName,
		"",
		flagutil.FlagDescription(fs.factory.Localizer, "kafka.acl.common.flag.operation.description", operations...),
	)
	_ = fs.cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
		return operations, cobra.ShellCompDirectiveNoSpace
	})
	return flagutil.WithFlagOptions(fs.cmd, flagName)
}
func ( fs * flagSet ) AddOperationFilter ( operationType * string ) * flagutil . FlagOptions { flagName := " " operationFilterMap := aclcmdutil . GetOperationFilterMap ( ) operations := make ( [ ] string , 0 , len ( operationFilterMap ) ) for i := range operationFilterMap { operations = append ( operations , i ) } fs . StringVar ( operationType , flagName , " " , flagutil . FlagDescription ( fs . factory . Localizer , " " , operations ... ) , ) _ = fs . cmd . RegisterFlagCompletionFunc ( flagName , func ( cmd * cobra . Command , args [ ] string , toComplete string ) ( [ ] string , cobra . ShellCompDirective ) { return operations , cobra . ShellCompDirectiveNoSpace } ) return flagutil . WithFlagOptions ( fs . cmd , flagName ) }
AddOperationFilter adds a flag for ACL operations filter and registers completion options
AddOperationFilter adds a flag for ACL operations filter and registers completion options