MCPcopy Index your code
hub / github.com/git-bug/git-bug / bugWithBackend

Function bugWithBackend

commands/bug/completion.go:29–41  ·  view source on GitHub ↗
(backend *cache.RepoCache, toComplete string)

Source from the content-addressed store, hash-verified

27}
28
29func 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
44func BugAndLabelsCompletion(env *execenv.Env, addOrRemove bool) completion.ValidArgsFunction {

Callers 2

BugCompletionFunction · 0.85
BugAndLabelsCompletionFunction · 0.85

Calls 6

HandleErrorFunction · 0.92
AllIdsMethod · 0.80
BugsMethod · 0.80
ResolveExcerptMethod · 0.80
StringMethod · 0.65
HumanMethod · 0.45

Tested by

no test coverage detected