Skip to content

Commit 4712487

Browse files
committed
Add model
1 parent 578e85d commit 4712487

File tree

2 files changed

+477
-0
lines changed

2 files changed

+477
-0
lines changed

main.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
7+
tea "github.com/charmbracelet/bubbletea"
8+
)
9+
10+
func main() {
11+
exitCode := run()
12+
os.Exit(exitCode)
13+
}
14+
15+
func run() int {
16+
model := &model{}
17+
program := tea.NewProgram(model, tea.WithAltScreen(), tea.WithOutput(os.Stderr))
18+
19+
exitCode := 0
20+
if err := program.Start(); err != nil {
21+
fmt.Fprintf(os.Stderr, "clidle: %s\n", err)
22+
exitCode = 1
23+
}
24+
for _, err := range model.errors {
25+
fmt.Fprintf(os.Stderr, "clidle: %s\n", err)
26+
exitCode = 1
27+
}
28+
return exitCode
29+
}

0 commit comments

Comments
 (0)