-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (30 loc) · 688 Bytes
/
Copy pathmain.go
File metadata and controls
38 lines (30 loc) · 688 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
package main
import (
"log/slog"
"os"
"github.com/treethought/attui/ui"
"github.com/bluesky-social/indigo/atproto/identity"
tea "github.com/charmbracelet/bubbletea"
)
type Client struct {
dir identity.Directory
}
func main() {
f, err := os.Create("/tmp/attui.log")
if err != nil {
slog.Error("failed to create log file", "error", err)
os.Exit(1)
}
defer f.Close()
slog.SetDefault(slog.New(slog.NewTextHandler(f, nil)))
slog.Info("starting attui")
query := ""
if len(os.Args) > 1 {
query = os.Args[1]
}
app := ui.NewApp(query)
p := tea.NewProgram(app, tea.WithAltScreen())
if _, err := p.Run(); err != nil {
slog.Error("program error", "error", err)
}
}