Skip to content

Commit 304b4a4

Browse files
committed
guard(cli): --help must advertise -cp on every eval subcommand line
The help text is externally consumed: BuddhiLW's editor integration probes `cljw --help` for `-cp` on the nrepl line to detect a classpath-capable build (Discussion #13 confirmation reply, 2026-08-11) — a build without the fix exits 1 on -cp, so the probe is how they avoid feeding -cp to older builds. That makes the help line a capability-detection API: check_entrypoint_surface.sh now fails when an eval subcommand's help line stops advertising -cp, alongside the existing subcommand-set and resolver-reachability checks.
1 parent faa1bd9 commit 304b4a4

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎scripts/check_entrypoint_surface.sh‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ for sc in "${EVAL_SUBCOMMANDS[@]}"; do
8181
fi
8282
done
8383

84+
# --- 3b: each eval subcommand's --help line advertises -cp. The help text is
85+
# externally consumed: at least one editor integration probes `cljw --help`
86+
# for `-cp` on the nrepl line to detect a classpath-capable build (Discussion
87+
# #13, 2026-08-11 confirmation reply). A help line that stops advertising -cp
88+
# silently breaks that capability detection even if the flag still works.
89+
for sc in "${EVAL_SUBCOMMANDS[@]}"; do
90+
help_line=$(grep -F "\\ $sc " "$CLI" | head -1 || true)
91+
if [ -z "$help_line" ] || ! printf '%s' "$help_line" | grep -q -- '-cp'; then
92+
echo "check_entrypoint_surface: --help line for '$sc' is missing or does not advertise -cp."
93+
echo " External integrations probe \`cljw --help\` for -cp capability detection."
94+
fail=1
95+
fi
96+
done
97+
8498
# --- 4: the default (file / -e / bare) path resolves the classpath too ---
8599
if ! awk '/fn dispatchArgsRest\(/,0' "$CLI" | grep -qE 'resolveClasspath|resolveDefaultClasspath|splitClasspath'; then
86100
echo "check_entrypoint_surface: dispatchArgsRest no longer reaches the shared classpath resolution."

0 commit comments

Comments
 (0)