Gim/cmd/gim/main.go
Hayden Hargreaves d4980c5532
All checks were successful
Run Test Suite / test (push) Successful in 15s
feat: created (tested) program_builder.
Also adjusted some of the IO tests for writing and force writing.
2026-03-10 14:18:20 -07:00

33 lines
655 B
Go

package main
import (
"os"
"git.gophernest.net/azpect/TextEditor/internal/program"
tea "github.com/charmbracelet/bubbletea"
)
// main: Entry point for the Gim text editor. Creates a buffer and window,
// initializes the editor model, and runs the BubbleTea TUI program.
func main() {
// <exe> <filename>
args := os.Args[1:]
var prog *tea.Program
if len(args) < 1 {
prog = program.NewProgramBuilder().
EmptyProgram().
WithOpt(tea.WithAltScreen()).
Build()
} else {
prog = program.NewProgramBuilder().
FileProgram(args[0]).
WithOpt(tea.WithAltScreen()).
Build()
}
if _, err := prog.Run(); err != nil {
panic(err)
}
}