summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorDavid Schlachter <t480-debian-git@schlachter.ca>2026-01-11 23:10:26 -0500
committerDavid Schlachter <t480-debian-git@schlachter.ca>2026-01-11 23:10:26 -0500
commit068ef1f9ac1fe551b97b9d5aec224369ebe015fd (patch)
tree9efc20ddfc2471e2096c0de14203a6e58abdfb57 /main.go
parent18a0b77981bc1590f558341870f8d35f8aec23c9 (diff)
Move dictionary preparation into the bubbletea app
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/main.go b/main.go
index f173107..696a101 100644
--- a/main.go
+++ b/main.go
@@ -41,16 +41,14 @@ func main() {
log.Fatalf("Failed to create or open dictionary at '%s': %s", *dict, err)
}
defer db.Close()
-
- err = setupDatabase(*rawDict, db)
- if err != nil {
- log.Fatalf("Failed to set up database: %s", err)
+ if err = setupTables(db); err != nil {
+ log.Fatalf("Failed to create database tables in dictionary '%s': %s", *dict, err)
}
c := http.DefaultClient
c.Timeout = 5 * time.Second
- p := tea.NewProgram(initialModel(c, db, *apiURL, *deckName, *modelName, *initialWord))
+ p := tea.NewProgram(initialModel(c, db, *apiURL, *deckName, *modelName, *rawDict, *initialWord))
if _, err := p.Run(); err != nil {
log.Fatalf("Unexpected error encountered while running program: %s", err)
}