2018-07-30 18:00:10 +03:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2018-08-31 14:18:03 +03:00
|
|
|
"github.com/MichaelMure/git-bug/cache"
|
2018-07-30 18:00:10 +03:00
|
|
|
"github.com/MichaelMure/git-bug/termui"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func runTermUI(cmd *cobra.Command, args []string) error {
|
2018-08-31 14:18:03 +03:00
|
|
|
backend, err := cache.NewRepoCache(repo)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
defer backend.Close()
|
|
|
|
|
|
|
|
return termui.Run(backend)
|
2018-07-30 18:00:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
var termUICmd = &cobra.Command{
|
|
|
|
Use: "termui",
|
|
|
|
Short: "Launch the terminal UI",
|
|
|
|
RunE: runTermUI,
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
RootCmd.AddCommand(termUICmd)
|
|
|
|
}
|