helm-2to3 icon indicating copy to clipboard operation
helm-2to3 copied to clipboard

Use Cobra to provide all shell completions

Open marckhouzam opened this issue 3 years ago • 0 comments

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 in completion.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.

marckhouzam avatar Feb 02 '22 20:02 marckhouzam