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

Function BugCompletion

commands/bug/completion.go:16–27  ·  view source on GitHub ↗

BugCompletion complete a bug id

(env *execenv.Env)

Source from the content-addressed store, hash-verified

14
15// BugCompletion complete a bug id
16func BugCompletion(env *execenv.Env) completion.ValidArgsFunction {
17 return func(cmd *cobra.Command, args []string, toComplete string) (completions []string, directives cobra.ShellCompDirective) {
18 if err := execenv.LoadBackend(env)(cmd, args); err != nil {
19 return completion.HandleError(err)
20 }
21 defer func() {
22 _ = env.Backend.Close()
23 }()
24
25 return bugWithBackend(env.Backend, toComplete)
26 }
27}
28
29func bugWithBackend(backend *cache.RepoCache, toComplete string) (completions []string, directives cobra.ShellCompDirective) {
30 for _, id := range backend.Bugs().AllIds() {

Callers 11

newBugStatusCloseCommandFunction · 0.85
newBugSelectCommandFunction · 0.85
newBugShowCommandFunction · 0.85
newBugCommentNewCommandFunction · 0.85
newBugCommentCommandFunction · 0.85
newBugRmCommandFunction · 0.85
newBugTitleEditCommandFunction · 0.85
newBugTitleCommandFunction · 0.85
newBugLabelCommandFunction · 0.85
newBugStatusCommandFunction · 0.85
newBugStatusOpenCommandFunction · 0.85

Calls 4

LoadBackendFunction · 0.92
HandleErrorFunction · 0.92
bugWithBackendFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected