summaryrefslogtreecommitdiff
path: root/internal/cli/cli.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/cli.go')
-rw-r--r--internal/cli/cli.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go
index 078d0c2..ffefd54 100644
--- a/internal/cli/cli.go
+++ b/internal/cli/cli.go
@@ -46,6 +46,8 @@ Flags:
--week list the coming week's gospel references and exit
-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-dump NAME dump the whole universal calendar to NAME.ini, commented,
+ to uncomment+edit one day (add -l trad for the 1962 form)
--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
@@ -132,7 +134,7 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int {
var list bool
var ref string
var liturgy bool
- var calNew, calCheck string
+ var calNew, calCheck, calDump string
var corpusCheck string
var jsonOut bool
var format, fromFlag, toFlag, yearFlag, formFlag string
@@ -174,6 +176,7 @@ 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(&calDump, "cal-dump", "", "dump the universal calendar to NAME.ini as a commented layer template 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")
fs.StringVar(&format, "format", "", "json|ical: emit the computed calendar and exit")
@@ -229,6 +232,10 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int {
cfg.UILanguage = config.NormalizeUILanguage(uiLang)
}
+ if calDump != "" {
+ return runCalDump(cfg, calDump, formFlag, stdout, stderr)
+ }
+
// `--year N` on its own prints the human-readable key-dates overview;
// with --format (or --from/--to) it emits the machine calendar via runFeed.
if yearFlag != "" && format == "" && fromFlag == "" && toFlag == "" {