Skip to content
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

Fix conflict of option -c with shell completion #7988

Merged
merged 1 commit into from May 20, 2022
Merged

Conversation

GromNaN
Copy link
Contributor

@GromNaN GromNaN commented May 19, 2022

Symfony Console 5.4+ provided shell completion, with 2 new default commands. completion to dump the script and _complete to return the values. The 2nd command define an option with shortcut -c that conflicts with the default option --config|-c in the psalm-plugin manager. By moving this option back to the 3 commands that use it, the completion can work.

Only command and option names can be completed for now. It would be useful if the pluginName could be autocompleted (using interactive questions or shell completion).

@orklah
Copy link
Collaborator

orklah commented May 19, 2022

We require "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0",

and you said completion changed in 5.4. Is this change backward compatible?

@GromNaN
Copy link
Contributor Author

GromNaN commented May 19, 2022

Yes that's backward compatible according to the Symfony BC policy: that's 2 new commands that are registered by default from 5.4. Here, the application needs the changes I proposed to support this new feature, but nothing is broken by the update.

The conflict is on the option defined there: https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Console/Command/CompleteCommand.php#L54

@AndrolGenhald
Copy link
Collaborator

I think @orklah was asking if your PR is backward compatible, especially since we allow symfony/console versions older than 5.4. It looks to me like it probably shouldn't be an issue though, although I haven't actually tested it. I assume you've actually run each of the commands with the -c flag before and after your change?

@GromNaN
Copy link
Contributor Author

GromNaN commented May 20, 2022

So not doubt, Command::addOption exists since Symfony 2.

I tested each command.

@orklah orklah added the release:internal The PR will be included in 'Internal changes' section of the release notes label May 20, 2022
@orklah orklah merged commit 50fb396 into vimeo:4.x May 20, 2022
@orklah
Copy link
Collaborator

orklah commented May 20, 2022

Thanks!

@GromNaN GromNaN deleted the completion branch August 24, 2022 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:internal The PR will be included in 'Internal changes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants