(backend *cache.RepoCache, toComplete string)
| 27 | } |
| 28 | |
| 29 | func bugWithBackend(backend *cache.RepoCache, toComplete string) (completions []string, directives cobra.ShellCompDirective) { |
| 30 | for _, id := range backend.Bugs().AllIds() { |
| 31 | if strings.Contains(id.String(), strings.TrimSpace(toComplete)) { |
| 32 | excerpt, err := backend.Bugs().ResolveExcerpt(id) |
| 33 | if err != nil { |
| 34 | return completion.HandleError(err) |
| 35 | } |
| 36 | completions = append(completions, id.Human()+"\t"+excerpt.Title) |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | return completions, cobra.ShellCompDirectiveNoFileComp |
| 41 | } |
| 42 | |
| 43 | // BugAndLabelsCompletion complete either a bug ID or a label if we know about the bug |
| 44 | func BugAndLabelsCompletion(env *execenv.Env, addOrRemove bool) completion.ValidArgsFunction { |
no test coverage detected