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

Fixes #3054: Only replace command aliases for commands #3066

Merged
merged 1 commit into from
Oct 14, 2017

Conversation

greg-1-anderson
Copy link
Member

Command aliases (e.g. 'en' + 'si') should only be replaced when they appear as the first non-option / non-alias parameter on the argv list.

…y appear as the first non-option / non-alias parameter on the argv list.
@TessBakker
Copy link
Contributor

This is a bug in Symfony Console (\Symfony\Component\Console\Application::find)

A sort is needed in de code of version 3.2.0:

$list = array_values($commands);
sort($list);
$suggestions = $this->getAbbreviationSuggestions($list);

In de latest version, aliases won't work if there isn't a command that begins like the alias. This is a bug in the same method, but then in the last if-statement

if (count($commands) > 1 && !$exact) {
Here is the count not needed.

When fixed, 'drush en abc' or 'drush si' works perfect when removed from \Drush\Preflight\Preflight::remapCommandAliases

@greg-1-anderson
Copy link
Member Author

@TessaBakker Is there a PR for this in Symfony?

@TessBakker
Copy link
Contributor

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.

2 participants