oh-my-bash
oh-my-bash copied to clipboard
We need a better system for handling completions
It seems that completion files are being re-created even when unnecessary. The better way would be to leverage official/recognized completion libraries.
For example, sjorek provides a completion file for composer here. sjorek also suggests symfony-console-autocomplete here.
Here's one solution that comes to mind
- remove from repo completions that our supported by the associated project
- don't automatically install those completions
- if a user adds to their
completionsvariable, say,'composer', give the user the option to have it installed by oh-my-bash the next time it's loaded.
Something like this, maybe:
if command -v composer; then
composer global require bamarni/symfony-console-autocomplete
symfony-autocomplete composer > ~/.oh-my-bash/completions/installed/composer
else
printf 'oh-my-bash: You have requested completion for composer, but composer is not installed\v'
fi
Something like that.
If there is interest, lemme know and I'll look into it.
EDIT: Another example source, for npm v6 -> v8
https://docs.npmjs.com/cli/v8/commands/npm-completion
bump?
I feel that should be controlled just by the array completions. I think the problem is that the default completions contains composer and ssh. As for the git completion, a related issue is #277, where we finally decided to search for the official completion first and only source the completion bundled with oh-my-bash when the official one is not found in the host. How about just removing composer and ssh from the default bashrc?