gospt/src/tui/tui.go

24 lines
493 B
Go
Raw Normal View History

2023-01-09 18:54:21 +00:00
package tui
import (
"fmt"
2023-03-09 20:58:12 +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 {
fmt.Println("UH OH")
}
P = tea.NewProgram(m, tea.WithAltScreen())
if err := P.Start(); err != nil {
return err
}
return nil
}