aboutsummaryrefslogtreecommitdiff
path: root/internal/cli/cli.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/cli.go')
-rw-r--r--internal/cli/cli.go10
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 {