Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@dereuromark
Copy link
Member

@dereuromark dereuromark commented Dec 6, 2025

Summary

When running a command prefix like cake cache (where cache itself is not a command but has subcommands like cache clear), show help for all commands with that prefix instead of showing an unhelpful "Did you mean" error message.

Before:

$ bin/cake cache
Unknown command `cake cache`. Did you mean: `cache clear`?

Other valid choices:

- help
- cache list
...

After:

$ bin/cake cache
Current Paths:
...

Available Commands:

cakephp:
 - cache clear
   └──────────── Clear all data in a single cache engine
 - cache list
   └──────────── Show a list of configured caches

To run a command, type `cake command_name [args|options]`
To get help on a specific command, type `cake command_name --help`

This improves discoverability of subcommands when users know the prefix but not the exact subcommand name.

Changes

  • CommandRunner: Detect when a command prefix has subcommands and redirect to help with that prefix as filter
  • HelpCommand: Add command argument to filter commands by prefix

Extracted bugfix from #19092 (separated from UI feature changes) for now to fast track the fixes while still discussing the UI changes.

othercorey and others added 2 commits December 5, 2025 16:11
When running a command prefix like `cake cache` (where `cache` itself
is not a command but has subcommands like `cache clear`), show help
for all commands with that prefix instead of showing an unhelpful
"Did you mean" error message.

This improves discoverability of subcommands when users know the
prefix but not the exact subcommand name.
@dereuromark dereuromark marked this pull request as ready for review December 6, 2025 04:25
@dereuromark dereuromark added this to the 5.3.0 milestone Dec 6, 2025
@dereuromark dereuromark changed the base branch from 5.x to 5.next December 6, 2025 04:26
@dereuromark dereuromark requested a review from markstory December 6, 2025 14:48
@markstory markstory merged commit 278b68c into 5.next Dec 6, 2025
14 of 15 checks passed
@markstory markstory deleted the 5.x-command-prefix-help-fixes-only branch December 6, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.