Add basic terminal user interface

This commit is contained in:
Olli 2025-10-16 07:59:16 +02:00
commit 5956331a28
9 changed files with 878 additions and 0 deletions

29
main.go Normal file
View file

@ -0,0 +1,29 @@
package main
import (
"fmt"
"log/slog"
"os"
"suruatoel.xyz/timefiles/lib"
"suruatoel.xyz/timefiles/tui"
)
func main() {
if len(os.Args) > 1 {
slog.Info(fmt.Sprintf("Set data directory to: %s", os.Args[1]))
lib.SetDataDir(os.Args[1])
}
tui, appErr := tui.NewTUI()
if appErr != nil {
slog.Error(fmt.Sprintf("Failed to initialize application: %s", appErr))
os.Exit(2)
}
runErr := tui.Run()
if runErr != nil {
slog.Error(fmt.Sprintf("Failed to run application: %s", runErr))
os.Exit(2)
}
}