(cmd *cobra.Command, p *[]string, name, shorthand string, defaultValues, options []string, usage string)
| 36 | } |
| 37 | |
| 38 | func StringSliceEnumFlag(cmd *cobra.Command, p *[]string, name, shorthand string, defaultValues, options []string, usage string) *pflag.Flag { |
| 39 | *p = defaultValues |
| 40 | val := &enumMultiValue{value: p, options: options} |
| 41 | f := cmd.Flags().VarPF(val, name, shorthand, fmt.Sprintf("%s: %s", usage, formatValuesForUsageDocs(options))) |
| 42 | _ = cmd.RegisterFlagCompletionFunc(name, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 43 | return options, cobra.ShellCompDirectiveNoFileComp |
| 44 | }) |
| 45 | return f |
| 46 | } |
| 47 | |
| 48 | type gitClient interface { |
| 49 | TrackingBranchNames(context.Context, string) []string |
no test coverage detected