From aaf3dc5ba55d46b6b318bb761305013f4c533b26 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Fri, 21 Aug 2026 12:09:35 +0200 Subject: fix(cli): diagnose an INI overlay passed to --overlay The INI overlay form is a SOURCE format that 'colitur convert' turns into the S-expression one. Handing the INI to --overlay instead failed deep in the sexp reader with 'more than one S-expression in file', which names neither the cause nor the cure -- and the shipped examples under data/ef/examples/ are exactly the files someone would try that with. The detector reads past the comment header to the first real line and looks for a [section]. Its first version capped that scan at 40 lines and poland.ini's own header is 43, so it silently never fired on the very file it was written for; the cap now bounds only how much of a binary gets read, and is not a guess at header length. --- test/cli.t | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/cli.t b/test/cli.t index fe18800..b2c2263 100644 --- a/test/cli.t +++ b/test/cli.t @@ -1270,6 +1270,17 @@ slug the engine can produce over 2020-2045: partial.ini: 1 of 725 celebrations named, 724 missing, 0 unknown partial.ini: 0 of 104 book names, 104 missing +An INI overlay handed to `--overlay` is DIAGNOSED, not left to fail inside the +sexp reader. The INI form is a source format that `colitur convert` turns into +the S-expression one; feeding it directly otherwise produced "more than one +S-expression in file", which names neither the cause nor the cure. + + $ printf '; a comment header\n\n[overlay]\nid = x\n' > o.ini + $ colitur day 2027 --overlay o.ini + colitur: o.ini looks like an INI overlay, not an S-expression one. + colitur: convert it first: colitur convert o.ini > overlay.sexp + [2] + `--check` REJECTS an unknown slug (exit 1), so a typo is visible rather than silently dead -- its author would otherwise never learn why the name they wrote never appears: -- cgit v1.3