29 lines
516 B
Go
29 lines
516 B
Go
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)
|
|
}
|
|
}
|