From 1610b0bf8b0df108b4eeda870e9cf2e83f9c5390 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Wed, 29 Jul 2026 01:05:08 +0200 Subject: 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). --- internal/cli/cli.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal/cli/cli.go') 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) } -- cgit v1.3