mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
28 lines
498 B
Go
28 lines
498 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/MichaelMure/git-bug/termui"
|
|
)
|
|
|
|
func newTermUICommand() *cobra.Command {
|
|
env := newEnv()
|
|
|
|
cmd := &cobra.Command{
|
|
Use: "termui",
|
|
Aliases: []string{"tui"},
|
|
Short: "Launch the terminal UI.",
|
|
PreRunE: loadBackendEnsureUser(env),
|
|
RunE: closeBackend(env, func(cmd *cobra.Command, args []string) error {
|
|
return runTermUI(env)
|
|
}),
|
|
}
|
|
|
|
return cmd
|
|
}
|
|
|
|
func runTermUI(env *Env) error {
|
|
return termui.Run(env.backend)
|
|
}
|