forked from DerTimonius/twkb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
52 lines (42 loc) · 637 Bytes
/
Copy pathmain.go
File metadata and controls
52 lines (42 loc) · 637 Bytes
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
45
46
47
48
49
50
51
52
package main
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
)
type status int
func (s status) getNext() status {
if s == done {
return todo
}
return s + 1
}
func (s status) getPrev() status {
if s == todo {
return done
}
return s - 1
}
const margin = 3
var board *Board
const (
todo status = iota
inProgress
done
never
)
func main() {
f, err := tea.LogToFile("/tmp/debug.log", "debug")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer f.Close()
board = NewBoard()
board.initLists()
p := tea.NewProgram(board)
if _, err := p.Run(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}