RegisterEventTypesCompletion suggests the known event types for a comma-separated flag. The flag still accepts any value, because the server may support event types that this build does not know about.
(cmd *cobra.Command, flag string)
| 10 | // RegisterEventTypesCompletion suggests the known event types for a comma-separated flag. The flag still accepts |
| 11 | // any value, because the server may support event types that this build does not know about. |
| 12 | func RegisterEventTypesCompletion(cmd *cobra.Command, flag string) { |
| 13 | _ = cmd.RegisterFlagCompletionFunc(flag, func(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 14 | return CompleteEventTypes(toComplete), cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp |
| 15 | }) |
| 16 | } |
| 17 | |
| 18 | // CompleteEventTypes returns the known event types that complete the last comma-separated item of toComplete, each |
| 19 | // prefixed with the preceding items and followed by its description. Types already listed are left out. |
no test coverage detected