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

Support command completion (and adjust our DDEV config accordingly) #5097

Merged
merged 16 commits into from
Nov 7, 2022

Conversation

weitzman
Copy link
Member

@weitzman weitzman commented Mar 19, 2022

It turns out that Symfony Console 5.4+ enables completion by default and its working in Drush. This PR configures our DDEV to demonstrate that. You must have DDEV 1.19+ (recently released).

  1. When I type drush core: and then TAB, I get no results on the first TAB and then good results on a second TAB. Anyone know whats up?
  2. I had to disable Drush's --debug option because Console ships with that option on its completion command. Can anyone find a way to harmonize this without Drush globally removing the option?
  3. I've added completion to the topic command. Anyone available to help add completion for arguments and option values for other commands?
    image

This PR brings in a small change to annotated-command - consolidation/annotated-command#275. (already merged is initial work at consolidation/annotated-command#274)

Todo

  • Drop composer.lock changes
  • Decide how to handle the --debug option conflict.
  • Make sure tests are passing

@weitzman weitzman added this to the drush12 milestone Apr 20, 2022
@greg-1-anderson
Copy link
Member

Using this natively on MacOS:

brew install bash-completion
eval "$(drush completion bash)"

However, it doesn't work like this. Typing drush topic <TAB> results in only two newlines. The topicComplete method doesn't seem to be called. Does the ddev environment work substantially differently than the MacOS / bsd bash environment? Do you know what command the _sf_drush bash function is calling to get the generated candidates?

# Conflicts:
#	composer.json
#	composer.lock
@weitzman
Copy link
Member Author

Just looped back to this PR and the associated annotated-command PR. Its working well except for the fact that I have to hit tab twice. Dunno why.

I havent tried testing with on OSX since I use ZSH there and that shell is not available until Drupal 10 is on Symfony 6.2. The DDEV environment in this repo is setup for testing.

@weitzman weitzman changed the title Support command completion in Drush's DDEV config Support command completion (and adjust our DDEV config accordingly) Oct 31, 2022
@weitzman weitzman marked this pull request as ready for review October 31, 2022 18:52
@weitzman weitzman merged commit fc3fae0 into drush-ops:11.x Nov 7, 2022
@weitzman weitzman deleted the completion54 branch November 7, 2022 14:38
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.

None yet

2 participants