summaryrefslogtreecommitdiff
path: root/test/cli.t
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukasz@arcofasiagroup.com>2026-08-27 15:45:49 +0200
committerLukasz Kasprzak <lukasz@arcofasiagroup.com>2026-08-27 15:45:49 +0200
commitf1d562a3a4d53a707385334ab553b8a6cad36b1b (patch)
treef3bb14fbdd1ddb78aadb25168e8af17491ae953c /test/cli.t
parent34a36fcb0956db7f06c4b8860414283c03996293 (diff)
downloadcolitur-f1d562a3a4d53a707385334ab553b8a6cad36b1b.tar.gz
colitur-f1d562a3a4d53a707385334ab553b8a6cad36b1b.zip
feat(cli): --pretty draws each day as an ASCII box
Aligned columns made the fields legible but the days ran together -- with 365 of them the eye had nothing to catch on. Each day now gets its own box: a heading carrying the date and the liturgical colour, then the celebration, its rank and season, and any commemorations, each on its own line. The box art is pure ASCII, only + - and |, never Unicode box-drawing. That is the point rather than a limitation: this format exists to be pasted or piped into a document, a mail or a plain-text ordo, and U+2500 and its relatives survive that only when every stage agrees about encoding and font. +---+ has never failed to render anywhere. readings gets a labelled block, so a citation says what it is instead of being the second of three bar-separated fields; the OF second reading simply omits its row on the days without one. rubrics becomes a label/value list. temporal is the day box minus the sanctoral it does not have. A blank line separates consecutive boxes -- without it the bottom rule of one day and the top rule of the next sit adjacent and read as a single doubled line, which is the same "not distinct enough" this change set out to fix. Alignment counts UTF-8 code points, not bytes, so "Pen~afort" and "Fremiot" still line the right edge up at 76 columns; a byte-counting pad shears the box by one per multi-byte character. Over-long values are truncated with a ~ rather than allowed to overflow, since a box whose right edge does not line up is worse than a clipped name that the default output still carries in full. Verified: no ANSI escape reaches a pipe on any of the four commands, and the default output is byte-identical to installed 1.1.0 across all five.
Diffstat (limited to 'test/cli.t')
-rw-r--r--test/cli.t14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/cli.t b/test/cli.t
index b19090a..ebc30f1 100644
--- a/test/cli.t
+++ b/test/cli.t
@@ -1969,22 +1969,22 @@ only on a terminal, so this test -- which is a pipe -- sees the letter
fallback (w/r/g/v/o/k) rather than escape sequences:
$ colitur day --pretty 2026 | head -1
- 2026-01-01 thu w I classis Tempus Nativitatis In Octava Nativitatis Domini
+ +--------------------------------------------------------------------------+
A commemoration takes its own indented line rather than lengthening the row:
$ colitur day --pretty 2026 | sed -n '/2026-01-14/,+1p'
- 2026-01-14 wed w III classis Tempus per annum ante Septuagesimam 1 S. Hilarii Ep., Conf. et Eccl. Doct.
- + S. Felicis Presbyt. et Mart.
+ | 2026-01-14 Wednesday white |
+ +--------------------------------------------------------------------------+
`readings --pretty` labels and stacks the citations, and prints the OF second
reading only on the days that have one:
$ colitur readings --rite of --pretty 2026 | head -4
- 2026-01-01 thu of-mary-mother-of-god
- First Num 6:22-27
- Second Gal 4:4-7
- Gospel Luc 2:16-21
+ +--------------------------------------------------------------------------+
+ | 2026-01-01 Thursday |
+ +--------------------------------------------------------------------------+
+ | of-mary-mother-of-god |
NO_COLOR is honoured on presence, whatever its value -- that is the
convention's own rule, and reading it as a boolean is how tools get it wrong: