Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] Handle alias in completion script #44475

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

Merged
merged 1 commit into from
Dec 7, 2021
Merged

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Dec 6, 2021

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #44461
License MIT
Doc PR -

Detect when completion is triggered by an alias and get the underlying command. Tip extracted from bamarni/symfony-console-autocomplete.

Works well with such alias:

alias console=bin/console

Doesn't work with these aliases (command name is not the 1st part of the alias):

alias console='APP_ENV=test bin/console'

When alias has a different name, the name in the completion script must be updated.

@GromNaN GromNaN requested a review from chalasr as a code owner December 6, 2021 16:30
@carsonbot carsonbot added this to the 5.4 milestone Dec 6, 2021
Copy link
Member

@chalasr chalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be taken into account by #43641 and #43970

@GromNaN GromNaN added the Console label Dec 6, 2021
@carsonbot carsonbot changed the title Handle alias in completion script [Console] Handle alias in completion script Dec 6, 2021
@OskarStark OskarStark requested a review from wouterj December 6, 2021 20:20
@wouterj
Copy link
Member

wouterj commented Dec 7, 2021

Thank you Jérôme!

@GromNaN GromNaN merged commit 060d328 into symfony:5.4 Dec 7, 2021
@GromNaN GromNaN deleted the issue-44461 branch December 7, 2021 12:56
This was referenced Dec 9, 2021
@apphancer
Copy link

Is there a way to have this work when using the Symfony CLI with symfony console or symfony php bin/console.
Using the Symfony CLI is a must, e.g. for doctrine commands when using Docker so that the Symfony binary can inject all of the environment variables.

Not sure if this is a similar related to this alias limitation issue or more to the Symfony CLI symfony-cli/symfony-cli#146 but not sure

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.

5 participants