From 34a36fcb0956db7f06c4b8860414283c03996293 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Thu, 27 Aug 2026 14:12:43 +0200 Subject: feat(cli): --pretty, for reading in a terminal The row commands print for awk: single-space fields, slugs, a variable tail. That is right for the default and wrong for a person, who mostly wants to know what today is. --pretty gives the same four commands -- day, readings, rubrics, temporal -- aligned columns, the day's liturgical colour as a swatch, and commemorations on their own indented line rather than lengthening the row. The colour was already computed and simply thrown away on a terminal. Colour is written only when stdout is a terminal, so piping or redirecting yields plain aligned text: the alignment survives, the escapes do not, and the swatch degrades to the colour's initial so the information is not lost with them. NO_COLOR is honoured on PRESENCE whatever its value, which is the convention's own rule -- treating it as a boolean is the usual way to get it wrong. Every other command refuses the flag rather than accepting it and doing nothing: emit, table, render and publish already choose their shape through --format and --template, and easter prints six key/value lines, not a grid. An intermediate version accepted it everywhere and silently ignored it on five commands, which is the failure mode this program refuses everywhere else. Two things the layout had to learn. Column widths are a minimum, not a maximum: the Latin season names run past them ("Tempus per annum ante Septuagesimam" is 35 against 34), so pad always leaves a separator or the next field fuses onto it -- that is how "Septuagesimam 1S. Hilarii" happened. And the commemoration indent is measured from the row actually printed rather than computed from the column constants, or it sits under the wrong column on exactly the rows that have something to indent. Presentation only: bin/pretty.ml decides nothing about what a day is, and nothing reads it. Default output is byte-identical to v1.1.0 -- verified across day, readings, rubrics, temporal and easter for 2026, 1583 and 9999. --- bin/dune | 1 + 1 file changed, 1 insertion(+) (limited to 'bin/dune') diff --git a/bin/dune b/bin/dune index 09c2009..a143250 100644 --- a/bin/dune +++ b/bin/dune @@ -1,5 +1,6 @@ (executable (name main) + (modules main pretty) (public_name colitur) (package colitur) ; [unix] ships with the OCaml compiler -- it is not a new entry in -- cgit v1.3