1package commands
 2
 3import (
 4	"github.com/spf13/cobra"
 5
 6	"github.com/git-bug/git-bug/commands/execenv"
 7	"github.com/git-bug/git-bug/termui"
 8)
 9
10func newTermUICommand(env *execenv.Env) *cobra.Command {
11	cmd := &cobra.Command{
12		Use:     "termui",
13		Aliases: []string{"tui"},
14		Short:   "Launch the terminal UI",
15		PreRunE: execenv.LoadBackendEnsureUser(env),
16		RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error {
17			return runTermUI(env)
18		}),
19	}
20
21	return cmd
22}
23
24func runTermUI(env *execenv.Env) error {
25	return termui.Run(env.Backend)
26}