gospt/src/tui/tui.go

22 lines
476 B
Go
Raw Normal View History

2023-01-09 18:54:21 +00:00
package tui
import (
2023-03-10 07:48:02 +00:00
"git.asdf.cafe/abs3nt/gospt/src/commands"
"git.asdf.cafe/abs3nt/gospt/src/gctx"
2023-01-09 18:54:21 +00:00
tea "github.com/charmbracelet/bubbletea"
)
// StartTea the entry point for the UI. Initializes the model.
2023-02-17 22:08:25 +00:00
func StartTea(ctx *gctx.Context, cmd *commands.Commands, mode string) error {
m, err := InitMain(ctx, cmd, Mode(mode))
2023-01-09 18:54:21 +00:00
if err != nil {
return err
2023-01-09 18:54:21 +00:00
}
P = tea.NewProgram(m, tea.WithAltScreen())
if _, err := P.Run(); err != nil {
2023-01-09 18:54:21 +00:00
return err
}
return nil
}