diff options
| author | David Schlachter <t480-debian-git@schlachter.ca> | 2026-01-08 11:22:29 -0500 |
|---|---|---|
| committer | David Schlachter <t480-debian-git@schlachter.ca> | 2026-01-08 11:22:29 -0500 |
| commit | c540abdd1d1465227e9b6b387570ee5a4d267bf4 (patch) | |
| tree | 4f16e9caafa0a5c1f1432d0c628358f1314a5814 /main.go | |
| parent | 63c3a174827aa431237e80bb210166dcd0e186dc (diff) | |
Make API url configurable
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -13,15 +13,12 @@ import ( _ "github.com/mattn/go-sqlite3" ) -const ( - apiURL = "http://localhost:8765" -) - func main() { rawDict := flag.String("rawDictionary", "raw-wiktextract-data.jsonl", "Path to the raw wiktionary data. You can get this by downloading and unzipping https://kaikki.org/frwiktionary/raw-wiktextract-data.jsonl.gz (for French).") dict := flag.String("dictionary", "dictionary.sqlite3", "Path to the parsed dictionary data. This will be generated from rawDictionary.") 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.") flag.Parse() @@ -52,7 +49,7 @@ func main() { c := http.DefaultClient c.Timeout = 5 * time.Second - p := tea.NewProgram(initialModel(c, db, *deckName, *modelName)) + p := tea.NewProgram(initialModel(c, db, *apiURL, *deckName, *modelName)) if _, err := p.Run(); err != nil { log.Fatalf("Unexpected error encountered while running program: %s", err) } |
