french-wiktionary-flashcards

Easily create Anki flashcards from Wiktionary data.
Log | Files | Refs | README

commit fd50a9d9b9e0ba108e001dc248319de696ad6546
parent 38cd475b37026775c7d0d1ab825636bea5d304f4
Author: David Schlachter <mba-debian-git@schlachter.ca>
Date:   Tue, 29 Sep 2026 13:19:29 -0400

Friendlier error if dictionary argument is not provided

Diffstat:
Mmain.go | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/main.go b/main.go @@ -4,9 +4,11 @@ package main import ( "database/sql" + "errors" "flag" "log" "net/http" + "os" "time" tea "github.com/charmbracelet/bubbletea" @@ -55,6 +57,10 @@ func main() { log.Fatal( "The -rawDictionary flag cannot be empty. (Defaults to raw-wiktextract-data.jsonl.)", ) + } else if *rawDict == "raw-wiktextract-data.jsonl" { + if _, err := os.Stat("./raw-wiktextract-data.jsonl"); errors.Is(err, os.ErrNotExist) { + log.Fatal("Could not find raw dictionary data file! You can get this by downloading and gunzipping https://kaikki.org/frwiktionary/raw-wiktextract-data.jsonl.gz.") + } } if *deckName == "" { log.Fatal("The -deck flag must be provided (name of the deck where Anki cards will be created).")