helm / helm-2to3

⚠️(OBSOLETE) This is a Helm v3 plugin which migrates and cleans up Helm v2 configuration and releases in-place to Helm v3
Apache License 2.0
493 stars 80 forks source link

Use Cobra to provide all shell completions #199

Closed marckhouzam closed 2 years ago

marckhouzam commented 2 years ago

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 commented 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.

hickeyma commented 2 years ago

Ok, thanks for the feedback @marckhouzam. I will close it out as not adding this feature.