aboutsummaryrefslogtreecommitdiffstats
path: root/commands/termui.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-11-22 14:53:15 +0100
committerGitHub <noreply@github.com>2022-11-22 14:53:15 +0100
commit70bd7377b6362127794f3a6198dd2c63863025fc (patch)
treee159372673104ade1f15ddc1a84aa9da93e93552 /commands/termui.go
parenta3fa445a9c76631c4cd16f93e1c1c68a954adef7 (diff)
parentacc9a6f3a6df2961c3ae44352216d915cb9b5315 (diff)
downloadgit-bug-70bd7377b6362127794f3a6198dd2c63863025fc.tar.gz
Merge pull request #870 from MichaelMure/cli-reorg
commands: reorg into different packages
Diffstat (limited to 'commands/termui.go')
-rw-r--r--commands/termui.go13
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)
}