summaryrefslogtreecommitdiff
path: root/internal/cli/cli.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-29 01:05:08 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-29 01:05:08 +0200
commit1610b0bf8b0df108b4eeda870e9cf2e83f9c5390 (patch)
tree18c2ff0f0c97b33426c985911b05e768beadd03d /internal/cli/cli.go
parentfd950f027300d3185c7b66b06981eddcfcfead4f (diff)
downloadlectio-1610b0bf8b0df108b4eeda870e9cf2e83f9c5390.tar.gz
lectio-1610b0bf8b0df108b4eeda870e9cf2e83f9c5390.zip
cli: --year N prints the year's key liturgical dates
On its own, `--year N` now prints a human-readable overview of the year's key dates -- season boundaries, solemnities and feasts of the Lord -- computed from the engine for the configured form (and custom-calendar layers), paged when a pager is configured. With --format json|ical it still emits the machine calendar (runFeed) as before. Numbered seasonal Sundays and Octave weekdays are omitted from the solemnity list (the season boundary already marks them).
Diffstat (limited to 'internal/cli/cli.go')
-rw-r--r--internal/cli/cli.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go
index 56de12b..078d0c2 100644
--- a/internal/cli/cli.go
+++ b/internal/cli/cli.go
@@ -59,7 +59,8 @@ Flags:
--format WHICH json|ical: emit the computed calendar and exit
--from DATE range start YYYY-MM-DD (with --to; needs --format)
--to DATE range end YYYY-MM-DD (with --from; needs --format)
- --year YYYY emit the whole year YYYY (needs --format)
+ --year YYYY key dates of the year -- seasons & solemnities (add
+ --format json|ical to emit the machine calendar instead)
--form WHICH override calendar form old|new (needs --format)
-v, --version print the version and exit
-h, --help this help
@@ -228,6 +229,11 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int {
cfg.UILanguage = config.NormalizeUILanguage(uiLang)
}
+ // `--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 == "" {
+ return runYearOverview(cfg, yearFlag, formFlag, pagerFlag, noPager, stdout, stderr)
+ }
if format != "" || fromFlag != "" || toFlag != "" || yearFlag != "" || formFlag != "" {
return runFeed(cfg, format, date, fromFlag, toFlag, yearFlag, formFlag, stdout, stderr)
}