diff options
author | Michael Muré <batolettre@gmail.com> | 2022-09-10 11:09:19 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2022-11-20 17:18:09 +0100 |
commit | acc9a6f3a6df2961c3ae44352216d915cb9b5315 (patch) | |
tree | e159372673104ade1f15ddc1a84aa9da93e93552 /commands/termui.go | |
parent | a3fa445a9c76631c4cd16f93e1c1c68a954adef7 (diff) | |
download | git-bug-acc9a6f3a6df2961c3ae44352216d915cb9b5315.tar.gz |
commands: reorg into different packages
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) } |