diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 20:29:31 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 20:29:31 +0200 |
| commit | 0bcddd4ed0aff66452397dc0973337c535c0d2ed (patch) | |
| tree | fffae4df5ba0efe80c0f7c2501ebf0396e438fdd /internal/cli/cli.go | |
| parent | 399f0d428050ee104f16e8d4a289b65a4a68eb13 (diff) | |
| download | lectio-0bcddd4ed0aff66452397dc0973337c535c0d2ed.tar.gz lectio-0bcddd4ed0aff66452397dc0973337c535c0d2ed.zip | |
feat(cli): lectio --corpus-check validator
Diffstat (limited to 'internal/cli/cli.go')
| -rw-r--r-- | internal/cli/cli.go | 10 |
1 files changed, 10 insertions, 0 deletions
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 <code>.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 <code>.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 { |
