Inspired from https://github.com/cli/cli/blob/trunk/pkg/cmdutil/json_flags.go#L26
( allowedMap map[string]string, prefixAllDescription string, )
| 42 | |
| 43 | // Inspired from https://github.com/cli/cli/blob/trunk/pkg/cmdutil/json_flags.go#L26 |
| 44 | func StringSliceCompletionFunc( |
| 45 | allowedMap map[string]string, |
| 46 | prefixAllDescription string, |
| 47 | ) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 48 | return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 49 | return runStringSliceCompletion(allowedMap, toComplete, prefixAllDescription) |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | func runStringSliceCompletion( |
| 54 | allowedMap map[string]string, |
no test coverage detected