summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorDavid Schlachter <t480-debian-git@schlachter.ca>2026-01-08 13:29:44 -0500
committerDavid Schlachter <t480-debian-git@schlachter.ca>2026-01-08 13:29:44 -0500
commit882c41c7df91a8851e904caa85f9a8259ac44570 (patch)
treeae506b70ee47a51cebd299b25d79f9c904d1d84b /main.go
parentd30e386491024e3740ac27039cd6b0dd5bb15334 (diff)
Allow invoking with a word to look up
Diffstat (limited to 'main.go')
-rw-r--r--main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.go b/main.go
index 809dd9d..f173107 100644
--- a/main.go
+++ b/main.go
@@ -19,6 +19,7 @@ func main() {
deckName := flag.String("deck", "", "Name of the deck where new Anki cards will be created.")
modelName := flag.String("model", "", "Name of the card type ('model') for new Anki cards.")
apiURL := flag.String("apiURL", "http://localhost:8765", "Base URL to access the anki-connect plugin API.")
+ initialWord := flag.String("initialWord", "", "Optional: first word to look up on program launch.")
flag.Parse()
@@ -49,7 +50,7 @@ func main() {
c := http.DefaultClient
c.Timeout = 5 * time.Second
- p := tea.NewProgram(initialModel(c, db, *apiURL, *deckName, *modelName))
+ p := tea.NewProgram(initialModel(c, db, *apiURL, *deckName, *modelName, *initialWord))
if _, err := p.Run(); err != nil {
log.Fatalf("Unexpected error encountered while running program: %s", err)
}