1package commands
2
3import (
4 "github.com/MichaelMure/git-bug/cache"
5 "github.com/MichaelMure/git-bug/termui"
6 "github.com/spf13/cobra"
7)
8
9func runTermUI(cmd *cobra.Command, args []string) error {
10 backend, err := cache.NewRepoCache(repo)
11 if err != nil {
12 return err
13 }
14 defer backend.Close()
15
16 return termui.Run(backend)
17}
18
19var termUICmd = &cobra.Command{
20 Use: "termui",
21 Short: "Launch the terminal UI",
22 RunE: runTermUI,
23}
24
25func init() {
26 RootCmd.AddCommand(termUICmd)
27}