From 0506388da160a15ceddb0cea1a697d737103d5c4 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 11 Aug 2026 16:23:57 +0200 Subject: cli: emit "-" for an absent week, keeping output column-safe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit week is "" for roughly 30 days a year (any day outside a numbered week). Printed as-is among seven space-separated fields, that collapses two fields into a double space, so naive field-position parsing (e.g. awk '{print $4}') silently reads the wrong column on those days -- a real defect for a project whose stated design is Unix-composable CLIs. Emit "-" instead, so every line always has exactly seven single-space-separated fields. Record.headers/to_row exist for exactly this kind of column-safe encoding but use a different column set and order than this CLI's documented date/weekday/season/week/slug/rank/colour format (design spec ยง6); adopting them here would be a larger, unrequested format change, so this keeps the CLI's own field list and only substitutes the empty value. The cram test's pinned lines are re-verified against liturgical anchors before promoting, not blind-promoted: 1 Jan 2026 (Circumcision, class-1, white) and 2-3 Jan (ordinary class-4 Christmastide ferias, the finding-1 slug fix already re-pinned separately) are correct; 2026-04-05 remains the sole Easter Sunday line, Paschaltide week 1, class-1, white, matching the independently-computed Easter anchors printed by `colitur easter 2026` immediately above in the same file. --- test/cli.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/cli.t b/test/cli.t index 79fdd1b..feb7c49 100644 --- a/test/cli.t +++ b/test/cli.t @@ -23,9 +23,9 @@ No/garbage arguments give a usage error (exit 2): The EF temporal cycle for a year, one line per day: $ colitur temporal 2026 | head -3 - 2026-01-01 thursday christmastide ef-circumcision class-1 white - 2026-01-02 friday christmastide ef-christmas-1-friday class-4 white - 2026-01-03 saturday christmastide ef-christmas-1-saturday class-4 white + 2026-01-01 thursday christmastide - ef-circumcision class-1 white + 2026-01-02 friday christmastide - ef-christmas-1-friday class-4 white + 2026-01-03 saturday christmastide - ef-christmas-1-saturday class-4 white $ colitur temporal 2026 | wc -l 365 -- cgit v1.3