Add basic terminal user interface
This commit is contained in:
parent
bf4e19378d
commit
5956331a28
9 changed files with 878 additions and 0 deletions
29
main.go
Normal file
29
main.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue