Skip to content

fix(cli): hints name the binary the user ran - #27

Merged
bpamiri merged 6 commits into
wheelsfrom
peter/binary-name-messages
Oct 6, 2026
Merged

bpamiri merged 6 commits into
wheelsfrom
peter/binary-name-messages

Conversation

@bpamiri

@bpamiri bpamiri commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Fork polish, queued after C3 (from the 2026-10-05 CLI docs sweep, C7's remaining part).

What

Under an aliased binary, error and next-step hints still told users to run lucli. For example, wheels server edit -f nope.json printed "Use 'lucli server new' to create a new lucee.json." Other examples: "Run 'lucli secrets init' …", "run 'lucli modules list' …", "Use 'lucli server list' …".

How

  • LuCLI.cliName() returns the active profile's name(), falling back to lucli.
  • 27 hard-coded 'lucli <command> hint strings in 14 files now concatenate cliName(). LuCLI.java calls it directly; the other files use org.lucee.lucli.LuCLI.cliName(), so no imports change.
  • Not changed: picocli @Command help/footer text, e.g. RunCommand's examples. Annotation values must be constants.

Tests

Fork bookkeeping

CHANGELOG ## Unreleased entry; FORK.md "Next queue" row 14 (fork-only polish). It will conflict on CHANGELOG/FORK.md with #23/#24/#26; I'll merge wheels in at its turn.

Upstream

Not filed separately. If wanted, it's a small upstream PR: upstream also has profiles, but its default alias handling differs.

🤖 Generated with Claude Code

bpamiri and others added 2 commits October 6, 2026 04:55
Hints such as "Use 'lucli server new' to create a new lucee.json" were
hard-coded to 'lucli', also under an aliased binary like 'wheels'.

LuCLI.cliName() returns the active profile's name (default 'lucli'), and
the 27 hard-coded hint strings in 14 files use it. picocli @command help
text is an annotation constant and is left as is.

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>
@bpamiri

bpamiri commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

rev1-r3 review @ 3c46be2: CHANGES (one missed hint in a block this PR edits)

End to end: JDK 21 jars, isolated LUCLI_HOME, sandboxed HOME / -Duser.home.

Run server edit -f nope.json unknown command nosuchthingxyz
base, -Dlucli.binary.name=wheels Use 'lucli server new' run 'lucli modules list' / Run 'lucli --help'
this branch, wheels Use 'wheels server new' run 'wheels modules list' / Run 'lucli --help' ⚠
this branch, plain lucli Use 'lucli server new' run 'lucli modules list' / Run 'lucli --help'

CliNameTest passes 2/0/0. cliName() is sound: the active profile's name(), falling back to lucli. Annotation strings are correctly left alone, because they must be compile-time constants.

Needs a fix

  • src/main/java/org/lucee/lucli/LuCLI.java:394: " - Run 'lucli --help' to see available commands" sits in the same unknown-command message as the modules list line this PR converts. Under the wheels alias, one message now names both binaries: "run 'wheels modules list' …" and then "Run 'lucli --help' …". It needs '" + cliName() + " --help'. The sweep missed it because the help flag follows lucli directly rather than a subcommand.

Optional, and fine to leave as a follow-up: the built-in src/main/resources/modules/lang/Module.cfc:57 still prints "Use 'lucli lang help'". That's CFML, so it would need the name from the Java side, which makes it a different shape of change.

Everything else (27 strings in 14 files, no import churn, the CHANGELOG entry and FORK.md row 14) is fine. Re-review is quick once the one line is in.

bpamiri and others added 4 commits October 6, 2026 05:00
The unknown-command message said "run 'wheels modules list'" and then
"Run 'lucli --help'": the hint with a flag after 'lucli' was missed.
Review follow-up on #27.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
Eight writeOutput() help strings in modules/lang/Module.cfc contained a
lone '#' ('# e.g., ...'), which CFML parses as an expression delimiter:
the module failed to compile ('Invalid identifier' at line 121) and was
unusable. Escaped as '##'. Also: the module's unknown-command hint now
names the active binary (LuCLI.cliName()), as requested on #27.

The same unescaped '#' is on upstream main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
…essages

Signed-off-by: Peter Amiri <peter@alurium.com>

# Conflicts:
#	CHANGELOG.md
#	FORK.md
…bersonic#147

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Unit Tests (ubuntu-latest, Java 21)

 65 files   65 suites   2m 31s ⏱️
782 tests 776 ✅ 6 💤 0 ❌
787 runs  781 ✅ 6 💤 0 ❌

Results for commit ced9d1c.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Integration Tests (ubuntu-latest, Java 21)

78 tests   78 ✅  2m 4s ⏱️
14 suites   0 💤
 1 files     0 ❌

Results for commit ced9d1c.

@bpamiri

bpamiri commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

rev1-r3 review @ ced9d1c: APPROVE (final)

Changes since my CHANGES at 3c46be2:

  • dff75a0: LuCLI.java:394 now builds the --help hint from cliName().
  • b4230cc: the lang module's line-57 hint uses LuCLI.cliName() through the Java static, and 8 help strings escape # as ##.
  • 529d07d: merge of wheels. The PR's src/ changes against wheels are 3c46be2's plus dff75a0 and b4230cc, nothing else. FORK.md keeps rows 9–14 in order.
  • ced9d1c: CHANGELOG links only.

End to end (JDK 21 jars, isolated LUCLI_HOME, sandboxed HOME / -Duser.home):

base wheels this head
unknown command, -Dlucli.binary.name=wheels run 'lucli modules list' / Run 'lucli --help' run 'wheels modules list' / Run 'wheels --help' (consistent now)
unknown command, plain lucli lucli / lucli lucli / lucli (unchanged)
modules run lang main (bundled lang module copied into the sandbox home) compile error Invalid identifier, at [121:56] … "# e.g., lucli lang set es" prints the language settings (Language Code: en, Locale: en_US, …)

The ## escape fixes a real compile error that affects the fork and upstream alike (cybersonic#146). As noted, the line-57 hint can't be reached from the CLI, so it's code-reviewed only. That's fine, because the static call shape compiles and is the same one the probe modules use.

PR CI on this head: 8 pass (Build ×3, Unit ×3, Integration ×2); APT smoke skipped. mergeStateStatus is CLEAN.

Ready to merge.

@bpamiri
bpamiri merged commit 6016440 into wheels Oct 6, 2026
11 checks passed
@bpamiri
bpamiri deleted the peter/binary-name-messages branch October 6, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant