Skip to content

Shell completion #6440

@Luap99

Description

@Luap99

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

The current bash autocompletion is hard to maintain and buggy. Cobra can create completion shell scripts. This was already tried in PR #4768 but dropped because the lack of autocompletion support for containers/pods/volumes/etc...

With the current cobra version 1.0.0 you can now add a custom function to do this for flags and args
cobra documentation:
main completion
flag completion

With this it would be possible to create autocompletion scripts for bash, zsh, fish, and powershell!

I would take the time to implement this if this is wanted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.stale-issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions