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.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)
}