You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there's no autocompletion for custom command argumentss. This means users have to constantly check help to see what arguments are available to them.
Describe your solution
There are two kinds of autocompletion at play:
static completion - i.e. specific values that can be used for arguments which are known ahead of time
dynamic completion - i.e. values that are evaluated at runtime, most likely through a bash function
The static completion would be really easy to add via a new annotation, e.g. the annotation for ddev xdebug might look like this:
Dynamic completion would require a bash script that's separate to the main command script.
I recommend having a autocompletion subdirectory inside each service command dir. Any script inside the autocompletion directory which matches the name of a command will be used as the script to call for autocompletions.
Above, when setting up the nvm command, the ~/.ddev/commands/web/autocompletion/nvm script will be used for any autocompletions.
Describe alternatives
No response
Additional context
Static Flag autocompletion is already provided. We could look at doing dynamic flag autocompletion as well (e.g. completion for values that can be passed to flags).
Any discussion about that should be included in this issue, because it will likely affect the way this is implemented. Forking that off as a separate conversation would risk implementing autocompletion for args in a way that makes it difficult to introduce dynamic flag autocompletion without breaking changes.
The text was updated successfully, but these errors were encountered:
Note that I mention flag completion here - but it turns out that can be handled in the same script that handles arg completion. If the user types ddev my-command --<tab>, the -- will be included in the args passed to the autocomplete script, and the script can return suggested flags (prefixed with --).
Is there an existing issue for this?
Is your feature request related to a problem?
Currently there's no autocompletion for custom command argumentss. This means users have to constantly check
help
to see what arguments are available to them.Describe your solution
There are two kinds of autocompletion at play:
The static completion would be really easy to add via a new annotation, e.g. the annotation for
ddev xdebug
might look like this:## AutocompleteTerms: ["on","off","enable","disable","toggle","status"]
Dynamic completion would require a bash script that's separate to the main command script.
I recommend having a
autocompletion
subdirectory inside each service command dir. Any script inside theautocompletion
directory which matches the name of a command will be used as the script to call for autocompletions.e.g.
Above, when setting up the
nvm
command, the~/.ddev/commands/web/autocompletion/nvm
script will be used for any autocompletions.Describe alternatives
No response
Additional context
Static Flag autocompletion is already provided. We could look at doing dynamic flag autocompletion as well (e.g. completion for values that can be passed to flags).
Any discussion about that should be included in this issue, because it will likely affect the way this is implemented. Forking that off as a separate conversation would risk implementing autocompletion for args in a way that makes it difficult to introduce dynamic flag autocompletion without breaking changes.
The text was updated successfully, but these errors were encountered: