Repository navigation
fix(modules): root flags before a reserved subcommand under an alias - #24
Conversation
The reserved-token rule (row 2) decides whether a reserved root subcommand is the leading token or a module positional by looking at args[1]. With a root flag first, 'wheels --timing cfml x' had args[1] = --timing, so 'cfml' was treated as a module positional and the whole command went to the module: the expression never ran. The leading position now skips root options and the separate value of --env/-e/--envfile/--timeout; a reserved token there is a root subcommand the user invoked directly. Reserved tokens later in a module command are still rewritten through 'modules run'. Fork-only: follows row 2 (upstream PR cybersonic#124). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
|
rev1-r3 review @ d35a1cc: code APPROVE (final pending PR CI: no checks are reported on this head yet) RED before, reproduced. I copied the updated End to end: aliased binary
Code: The CHANGELOG entry and FORK.md row 12 (fork-only) are fine. PR CI: |
|
rev1-r3 review @ a0e5058: APPROVE (final) The only change since the approved d35a1cc is a0e5058, Ready to merge. |
|
rev1-r3 correction @ a0e5058: this head conflicts with |
Signed-off-by: Peter Amiri <peter@alurium.com> # Conflicts: # CHANGELOG.md # FORK.md
Unit Tests (ubuntu-latest, Java 21) 63 files 63 suites 2m 27s ⏱️ Results for commit 9cf3fd8. |
Integration Tests (ubuntu-latest, Java 21)78 tests 78 ✅ 2m 3s ⏱️ Results for commit 9cf3fd8. |
|
rev1-r3 review @ 9cf3fd8: APPROVE (final; restores the final I withdrew at a0e5058) This head is a two-parent merge of a0e5058 (the approved d35a1cc plus the FORK.md row-12 link) and
PR CI on this head: it runs now that the PR no longer conflicts, and all 8 pass (Build ×3, Unit ×3, Integration ×2); APT smoke skipped. mergeStateStatus is CLEAN. Ready to merge. |
- pom.xml version 0.6.2.3 (the Windows file/product version follows
${project.version}); install-validation default 0.6.2.3.
- FORK.md: 'Next queue' becomes the 0.6.2.3 queue (rows 8-15: #19,
#21-#24, #26-#28), with the row-8 compatibility note (Wheels 4.1.x
stays at max 0.6.2.2: no __lucliMcpCall handling), and a new empty
Next queue.
- CHANGELOG unchanged: fork entries stay under Unreleased, as for
0.6.2.2.
Sandboxed mvn test (-Duser.home only): 788 run, 0 failures.
Signed-off-by: Peter Amiri <peter@alurium.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Fork-only: follows FORK.md row 2, the reserved-token rule (upstream PR cybersonic#124, still open). Found in the 2026-10-05 CLI docs sweep (C2).
What
Under an aliased binary, a root flag before a root subcommand handed the whole command to the module. For example,
wheels --timing cfml 'writeOutput(1)'andwheels --verbose cfml '…'printed the module's help (Wheels) or failed with "no function main", and exited 0 without running the expression. Without the flag (wheels cfml '…') it works. Upstream v0.6.1 andmain, which don't have row 2, run it.Why
rewriteModuleHelpOrReserved(row 2) treatsargs[1]as the leading position, and reserved root-subcommand tokens later than that as module positionals. With a root flag first,args[1]is--timing, socfmlat index 2 counted as a module positional, and the args were rewritten tomodules run wheels --timing cfml ….How
leadingPositionAfterRootOptions(args)skips root options, and the separate value of--env/-e/--envfile/--timeout(ROOT_OPTIONS_WITH_VALUE). It stops at--help/-h, which keep their existing handling.Tests
LuCLIModuleHelpPreprocessTest:rootFlagBeforeReservedSubcommand…,rootOptionWithSeparateValueBefore…,rootOptionWithInlineValueBefore…,rootFlagBeforeModuleSubcommand_reservedPositionalStillRewritten(regression guard) andleadingPositionSkipsRootOptionsAndTheirValues.wheels@ 8942048 (behaviour tests only, separate worktree): the 3 "not handed to the module" cases failed, and the regression guard passed.mvn testgave 774 tests, 0 failures, 0 errors, 6 skipped. BATS not run locally; please rely on CI.-Dlucli.binary.name=envprobe(a probe module, isolated home),--timing cfml 'writeOutput(1)'. v0.6.2.2:Component [modules.envprobe.Module] has no function with name [main]. This branch:1plus the timing report.Fork bookkeeping
CHANGELOG
## Unreleasedentry; FORK.md "Next queue" row 12 (marked fork-only, following row 2).Upstream
No separate upstream issue: upstream doesn't have the row-2 rule yet. If upstream takes cybersonic#124, this fix should go with it; I can offer it on cybersonic#124 then.
🤖 Generated with Claude Code