-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
44 lines (36 loc) · 817 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"fmt"
"log"
"os"
tea "github.com/charmbracelet/bubbletea"
)
// Models
var models []tea.Model
const (
board status = iota
form
projects
viewTask
)
func main() {
f, err := tea.LogToFile("debug.log", "debug")
if err != nil {
fmt.Println("fatal:", err)
os.Exit(1)
}
defer f.Close()
// NewBoard is defined in board.go
// NewForm is defined in form.go
// NewProjects is defined in projects.go
// NewViewTask is defined in view_task.go
log.Println("Starting Cli...")
// TODO confirm that the new form project here doesn't matter?
models = []tea.Model{NewBoard(0, 0, 0), NewForm(0, 0, todo, 0), NewProjectsTable(), NewViewTask(0, 0, Task{Name: "hi"})}
m := models[projects]
p := tea.NewProgram(m)
if _, err := p.Run(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}