Skip to content

[Console] Fix name/alias/usages when an invokable command has an alias #61367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: 7.4
Choose a base branch
from

Conversation

weitzman
Copy link
Contributor

@weitzman weitzman commented Aug 8, 2025

Q A
Branch? 7.4
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

Invokable commands don't construct their command name properly when an alias is present. This makes the command uncallable. The name has a pipe and alias appended such as example:name | my-alias. This appending is done by #[AsCommand]. You can see the effect by looking the test failure in the first commit to this PR.

The PR fixes the issue by removing a return when handling of invokables in Command::__construct(). We can mostly use same logic as non-invokables.

I discovered this while moving Drush (Drupal's CLI) to invokable commands.

@weitzman weitzman requested a review from chalasr as a code owner August 8, 2025 23:22
@carsonbot carsonbot added this to the 7.4 milestone Aug 8, 2025
@weitzman weitzman changed the title Fix name/alias/usages when an invokable command has an alias [Console] Fix name/alias/usages when an invokable command has an alias Aug 8, 2025
@weitzman weitzman marked this pull request as draft August 9, 2025 01:07
@weitzman weitzman marked this pull request as ready for review August 9, 2025 01:45
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.

2 participants