diff options
| -rw-r--r-- | bin/main.ml | 8 | ||||
| -rw-r--r-- | test/cli.t | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/bin/main.ml b/bin/main.ml index 827e6f2..896a6bd 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -21,6 +21,12 @@ let temporal_report y = | Ok t -> t | Error e -> failwith e in + (* [week] is "" for roughly 30 days a year (outside any numbered week); + printed as-is, that collapses two of the seven space-separated fields + into a double space, so naive field-position parsing (e.g. awk '{print + $4}') silently reads the wrong column on those days. Emit "-" instead, + so every line always has exactly seven single-space-separated fields. *) + let field s = if s = "" then "-" else s in let d = ref jan1 in while D.compare !d dec31 <= 0 do let t = Rite_ef.Temporal_ef.temporal !d in @@ -30,7 +36,7 @@ let temporal_report y = in Printf.printf "%s %s %s %s %s %s %s\n" r.Colitur_kernel.Record.date r.Colitur_kernel.Record.weekday r.Colitur_kernel.Record.season - r.Colitur_kernel.Record.week r.Colitur_kernel.Record.slug + (field r.Colitur_kernel.Record.week) r.Colitur_kernel.Record.slug r.Colitur_kernel.Record.rank r.Colitur_kernel.Record.colour; d := D.add_days !d 1 done @@ -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 |
