diff options
Diffstat (limited to 'commands/termui.go')
-rw-r--r-- | commands/termui.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/commands/termui.go b/commands/termui.go index 4df6cdaf..1cfdd8f3 100644 --- a/commands/termui.go +++ b/commands/termui.go @@ -3,18 +3,19 @@ package commands import ( "github.com/spf13/cobra" + "github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/termui" ) func newTermUICommand() *cobra.Command { - env := newEnv() + env := execenv.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 { + Short: "Launch the terminal UI", + PreRunE: execenv.LoadBackendEnsureUser(env), + RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error { return runTermUI(env) }), } @@ -22,6 +23,6 @@ func newTermUICommand() *cobra.Command { return cmd } -func runTermUI(env *Env) error { - return termui.Run(env.backend) +func runTermUI(env *execenv.Env) error { + return termui.Run(env.Backend) } |