summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cli.t114
1 files changed, 114 insertions, 0 deletions
diff --git a/test/cli.t b/test/cli.t
index ebc30f1..f604872 100644
--- a/test/cli.t
+++ b/test/cli.t
@@ -2005,3 +2005,117 @@ accepting it and quietly doing nothing:
$ colitur easter 2026 --pretty
colitur: --pretty has no effect on `easter`; refusing rather than ignoring it
[2]
+
+`--month N`, `--date` and `--today` narrow a report to part of a year. They are
+independent of `--pretty` -- the default format narrows too:
+
+ $ colitur day --month 3 2026 | wc -l
+ 31
+ $ colitur day --month 2 2028 | wc -l
+ 29
+ $ colitur day --date 2026-04-05
+ 2026-04-05 sunday paschaltide 1 ef-easter-sunday class-1 white Dominica Resurrectionis
+
+All four row commands honour them, `temporal` included:
+
+ $ colitur readings --rite of --date 2026-12-25
+ 2026-12-25 of-nativity | Isai 52:7-10 | Hebr 1:1-6 | Ioann 1:1-18
+ $ colitur rubrics --month 2 2026 | wc -l
+ 28
+ $ colitur temporal --date 2026-12-25
+ 2026-12-25 friday christmastide - ef-nativity class-1 white
+
+Under `--pretty` the same narrowing applies, one box per day:
+
+ $ colitur day --pretty --date 2026-04-05
+ +--------------------------------------------------------------------------+
+ | 2026-04-05 Sunday white |
+ +--------------------------------------------------------------------------+
+ | Dominica Resurrectionis |
+ | I classis . Tempus Paschatis, week 1 |
+ +--------------------------------------------------------------------------+
+
+
+`--today` prints today, whenever today is -- so this asserts the semantics
+rather than a fixed string:
+
+ $ [ "$(colitur day --today | cut -d' ' -f1)" = "$(date +%F)" ] && echo same
+ same
+ $ colitur day --today | wc -l
+ 1
+
+The three are alternatives, not a stack. Naming two is refused rather than one
+of them quietly winning:
+
+ $ colitur day --month 3 --today 2026
+ colitur: day: --month and --today are alternatives; name one
+ [2]
+ $ colitur day --date 2026-01-01 --month 3
+ colitur: day: --month and --date are alternatives; name one
+ [2]
+
+Bad values are rejected by the flag that owns them, not by a later failure:
+
+ $ colitur day --month 13 2026
+ colitur: day: --month wants a number 1-12, got 13
+ [2]
+ $ colitur day --month abc 2026
+ colitur: day: --month wants a number 1-12, got abc
+ [2]
+ $ colitur day --date 2026-13-01
+ colitur: day: --date 2026-13-01: month 13 out of range 1..12
+ [2]
+ $ colitur day --date 20260401
+ colitur: day: --date 20260401: date "20260401": expected YYYY-MM-DD
+ [2]
+ $ colitur day --month
+ colitur: --month needs a number 1-12
+ colitur: usage: colitur easter <year> | colitur temporal <year> | colitur day <year> | colitur readings <year> | colitur rubrics <year> | colitur emit --format FMT --from Y --to Y | colitur table --year Y --template FILE | colitur render --template FILE --year Y | colitur publish --from Y --to Y --out DIR | colitur lang --list|--dump CODE|--check FILE | colitur config --show | colitur check FILE | colitur new-overlay (try: colitur --help)
+ [2]
+
+`--date` and `--today` NAME a year, so the year may be omitted on those two --
+and must agree when given, the same rule the positional year and `--year`
+already follow. (The `sed` masks the current year, nothing else.)
+
+ $ colitur day --date 2026-04-05 | wc -l
+ 1
+ $ colitur day --date 2026-04-05 2027
+ colitur: day: year 2027 and --date 2026-04-05 (2026) disagree
+ [2]
+ $ colitur day --today 1583 2>&1 | sed 's/(....)/(YYYY)/'
+ colitur: day: year 1583 and --today (YYYY) disagree
+ $ colitur day --today 1583 >/dev/null 2>&1
+ [2]
+
+`--month` names no year, so it still needs one:
+
+ $ colitur day --month 3
+ colitur: day requires a year (positional, --year, --date or --today)
+ [2]
+
+`temporal` refuses `--year` yet takes `--date`/`--today`, including as its
+source of a year: `--year` is a second spelling of the positional year, which
+`temporal` does not offer, while `--date` selects a DAY and merely happens to
+determine which year contains it.
+
+ $ colitur temporal --year 2026
+ colitur: --year/--template/--flavour have no effect on `temporal`; refusing rather than ignoring them
+ [2]
+ $ colitur temporal --date 2026-12-25 | wc -l
+ 1
+
+Commands that cannot honour them refuse them, rather than accepting and
+quietly ignoring:
+
+ $ colitur easter 2026 --today
+ colitur: --month/--date/--today have no effect on `easter`; refusing rather than ignoring them
+ [2]
+ $ colitur emit --from 2026 --to 2026 --format csv --month 3
+ colitur: --month/--date/--today have no effect on `emit`; refusing rather than ignoring them
+ [2]
+ $ colitur table --year 2026 --template templates/ef/ordo.txt --today
+ colitur: --month/--date/--today have no effect on `table`; refusing rather than ignoring them
+ [2]
+ $ colitur config --show --month 3
+ colitur: --month/--date/--today have no effect on `config`; refusing rather than ignoring them
+ [2]