summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-02 12:30:56 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-02 12:30:56 +0200
commit5dd14266f2609faadc3ec60077127a7ef7e8ac8b (patch)
treed083272016976f7f6ed957697110674061c89a17 /test
parent4fb9eac2fdb9bc22af2b63c1d5df6da7780b58cf (diff)
downloadcolitur-5dd14266f2609faadc3ec60077127a7ef7e8ac8b.tar.gz
colitur-5dd14266f2609faadc3ec60077127a7ef7e8ac8b.zip
feat(cli): --help is one screen, not the whole manual
It printed 374 lines: every output format, the RFC 4180 quoting rule, the template scope hazard, the publish manifest semantics. All of that is real documentation and all of it is already in colitur(1), installed beside the binary. A help text nobody reads at the terminal is not more helpful than a short one, it is less -- the reader stops looking. Now 42 lines: the commands, the flags most runs need, the year domain, the exit status, and where the rest lives. Everything removed is in the man pages, which is checked rather than assumed -- each dropped section has a counterpart section there. One thing moved rather than went. cli.t pinned `rubrics`' documented field list against what `rubrics` actually prints, because that field count drifted once already and stayed wrong for a whole review round. Deleting the prose would have quietly retired the check, so it now reads the worked example out of man/colitur.1 instead, and test/dune's cram stanza gains the man page as a dep -- a sandbox holds only what that stanza names. Mutation-tested: changing the documented example reddens the suite. The tagline also stopped saying "Roman rite, 1962" -- the OF has shipped since v1.1.0.
Diffstat (limited to 'test')
-rw-r--r--test/cli.t29
-rw-r--r--test/dune9
2 files changed, 25 insertions, 13 deletions
diff --git a/test/cli.t b/test/cli.t
index f604872..00bbc21 100644
--- a/test/cli.t
+++ b/test/cli.t
@@ -578,10 +578,10 @@ error, exit 2, leaving stdout clean for whatever the caller was really trying
to capture.
$ colitur --help | head -1
- colitur -- deterministic liturgical calendar engine (Roman rite, 1962)
+ colitur -- deterministic liturgical calendar engine (Roman rite, EF 1962 and OF)
$ colitur -h | head -1
- colitur -- deterministic liturgical calendar engine (Roman rite, 1962)
+ colitur -- deterministic liturgical calendar engine (Roman rite, EF 1962 and OF)
$ colitur --help > /dev/null
$ colitur -h > /dev/null
@@ -601,21 +601,26 @@ is the check that catches help text drifting away from the dispatch:
$ for c in easter temporal day readings rubrics; do colitur $c 2026 > /dev/null || echo "$c FAILED"; done
`rubrics`' own field count drifted once already (Task 5 landed a fourth
-column, creed; --help's "output formats" section and its worked example
+column, creed; the documented "output formats" section and its worked example
still showed three, and stayed wrong for a whole review round because
-nothing here pinned the help BODY, only command dispatch above). This
-compares --help's own worked example against what `rubrics` actually
+nothing here pinned the documentation BODY, only command dispatch above). This
+compares the DOCUMENTED worked example against what `rubrics` actually
prints for the identical day, so the two cannot silently drift apart
-again in either direction:
+again in either direction.
- $ colitur --help | grep '^ rubrics date'
- rubrics date, formulary slug, source, creed, gloria, preface [name] -- TAB-separated
+The comparison reads the man page, not --help: --help was trimmed to one
+screen and now points at colitur(1) for every format, so this is where the
+worked example lives. The man page is named in test/dune's own cram deps for
+exactly this reason -- a cram sandbox holds only what that stanza lists.
- $ colitur --help | sed -n '/^ rubrics date/{n;p}'
- 2026-01-01[TAB]ef-circumcision[TAB]own[TAB]true[TAB]true[TAB]nativity[TAB]In Octava Nativitatis Domini
+ $ grep -c 'formulary\\-slug .TAB. source .TAB. creed' ../man/colitur.1
+ 1
+
+ $ sed 's/\\//g' ../man/colitur.1 | grep -o '2026-01-01 \[TAB\] ef-circumcision.*' | head -1
+ 2026-01-01 [TAB] ef-circumcision [TAB] own [TAB] true [TAB] true [TAB] nativity [TAB] In Octava Nativitatis Domini
- $ colitur rubrics 2026 | grep '^2026-01-01' | sed $'s/\t/[TAB]/g'
- 2026-01-01[TAB]ef-circumcision[TAB]own[TAB]true[TAB]true[TAB]nativity
+ $ colitur rubrics 2026 | grep '^2026-01-01' | sed $'s/\t/ [TAB] /g'
+ 2026-01-01 [TAB] ef-circumcision [TAB] own [TAB] true [TAB] true [TAB] nativity
--version prints the version alone, to standard output, exit 0. Deliberately
not embedded in the help text above: this pin would then have to be edited
diff --git a/test/dune b/test/dune
index 0a3ade6..85facc9 100644
--- a/test/dune
+++ b/test/dune
@@ -105,4 +105,11 @@
../schema/day-v1.json
; Same trap, same fix: Task 8's --sigla-tradition flag makes the CLI read
; this file, and a cram sandbox holds only what this stanza names.
- ../lang/traditions.ini))
+ ../lang/traditions.ini
+ ; The man page is a DEP, not a runtime file the binary reads: cli.t's own
+ ; rubrics anti-drift check compares the documented worked example against
+ ; what `rubrics` actually prints, and that documentation now lives here
+ ; rather than in --help (trimmed to one screen). The check exists because
+ ; this exact field list drifted once and stayed wrong for a whole review
+ ; round; moving the prose without moving the check would quietly retire it.
+ ../man/colitur.1))