From 0bcddd4ed0aff66452397dc0973337c535c0d2ed Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 27 Jul 2026 20:29:31 +0200 Subject: feat(cli): lectio --corpus-check validator --- internal/cli/cli.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'internal/cli/cli.go') diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 65be274..eb01039 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -51,6 +51,9 @@ Flags: -L, --liturgy print the computed liturgical day (offline, no network) and exit --cal-new NAME scaffold a custom calendar layer ~/.config/lectio/calendars/NAME.ini --cal-check NAME validate a custom calendar layer NAME.ini and exit + --corpus-check X validate a bible corpus (code, e.g. drb, or a path to + a .tsv) and exit; errors fail, coverage gaps warn + --json with --corpus-check, print the report as JSON --rand, --rand-v print a random verse and exit (uses default_version or -b VER; bt has no corpus, so it falls back to a corpus version) --rand-ch print a random chapter and exit @@ -124,6 +127,8 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int { var ref string var liturgy bool var calNew, calCheck string + var corpusCheck string + var jsonOut bool fs := flag.NewFlagSet("lectio", flag.ContinueOnError) fs.SetOutput(stderr) @@ -172,6 +177,8 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int { fs.BoolVar(&liturgy, "liturgy", false, "print the computed liturgical day (offline calendar engine) and exit") fs.StringVar(&calNew, "cal-new", "", "scaffold a new calendar-layer file NAME.ini and exit") fs.StringVar(&calCheck, "cal-check", "", "validate the calendar-layer file NAME.ini and exit") + fs.StringVar(&corpusCheck, "corpus-check", "", "validate a bible corpus (code or path to .tsv) and exit") + fs.BoolVar(&jsonOut, "json", false, "with --corpus-check, print the report as JSON") if err := fs.Parse(rest); err != nil { return 2 @@ -203,6 +210,9 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int { if calCheck != "" { return runCalCheck(calCheck, stdout, stderr) } + if corpusCheck != "" { + return runCorpusCheck(corpusCheck, jsonOut, stdout, stderr) + } cfg, err := config.Load() if err != nil { -- cgit v1.3