aboutsummaryrefslogtreecommitdiffstats
path: root/commands/bug/bug_select.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/bug/bug_select.go')
-rw-r--r--commands/bug/bug_select.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/commands/bug/bug_select.go b/commands/bug/bug_select.go
index 2a4d1201..bfad899d 100644
--- a/commands/bug/bug_select.go
+++ b/commands/bug/bug_select.go
@@ -5,11 +5,16 @@ import (
"github.com/spf13/cobra"
- "github.com/MichaelMure/git-bug/commands/bug/select"
- "github.com/MichaelMure/git-bug/commands/completion"
+ "github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/commands/execenv"
+ _select "github.com/MichaelMure/git-bug/commands/select"
+ "github.com/MichaelMure/git-bug/entities/bug"
)
+func ResolveSelected(repo *cache.RepoCache, args []string) (*cache.BugCache, []string, error) {
+ return _select.Resolve[*cache.BugCache](repo, bug.Typename, bug.Namespace, repo.Bugs(), args)
+}
+
func newBugSelectCommand() *cobra.Command {
env := execenv.NewEnv()
@@ -33,7 +38,7 @@ The complementary command is "git bug deselect" performing the opposite operatio
RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error {
return runBugSelect(env, args)
}),
- ValidArgsFunction: completion.Bug(env),
+ ValidArgsFunction: BugCompletion(env),
}
return cmd
@@ -51,7 +56,7 @@ func runBugSelect(env *execenv.Env, args []string) error {
return err
}
- err = _select.Select(env.Backend, b.Id())
+ err = _select.Select(env.Backend, bug.Namespace, b.Id())
if err != nil {
return err
}