Open zachriggle opened 4 years ago
It would be nice feature to have but unfortunately it's not that easy to implement.
For now you can use https://github.com/dim-an/cod#configuration. Please check out example configration. You can set up rules to ignore binaries in some paths.
Example of config rule to make cod
ignore binaries from /usr/bin/*
:
[[rule]]
executable = "/usr/bin/*"
policy = 'ignore'
You can still learn ignored binaries using cod learn -- some-binary --help
Regarding why I think this feature is not easy.
When I researched how completion is implemented in bash
I found out that most of them are loaded lazily, i.e. at the start of the session compdef
doesn't show that it knows anything about git
. But when you try to complete git command, bash_completion
package looks for corresponding completion and loads it.
I didn't looked at zsh, but looks like something similar happens here. Output of zstyle | grep git
is empty for me although git
have some completions.
zsh
already ships with lots of completion scripts.cod
attempts to learn these, even though they already exist.For example:
cod
should probably checkzstyle
orcompdef
to determine which autocompletions are already available.