Closed marckhouzam closed 2 years ago
Bah, we should probably not merge this since the value-add is smaller than the regression for older helm version.
I wanted to at least post it as our could be a reference for other plugins.
Ok, thanks for the feedback @marckhouzam. I will close it out as not adding this feature.
This comes a little late since this project is pretty stable but I have been working on making this happen for 18 months (https://github.com/spf13/cobra/pull/1161), so here it is anyway.
Cobra automatically provides support for flag and command completion. By using helm's dynamic completion for plugins, we can use Cobra's support in a
plugin.complete
file instead of coding things ourselves incompletion.yaml
.This removes the need to keep the now removed
completion.yaml
up to date with any new command or flag.This change requires the use of Helm 3.8 that uses Cobra 1.3. So, this change will cause a regression to shell completion for older versions of helm, so I'm not sure if we want the change or not, but I wanted to at least suggest it.
Furthermore, with this change, adding shell completions for release names and such in helm-2to3 would then automatically work when used as a plugin.