kubernetes-sigs / cluster-api

Home for Cluster API, a subproject of sig-cluster-lifecycle
https://cluster-api.sigs.k8s.io
Apache License 2.0
3.5k stars 1.3k forks source link

bash/zsh auto completion for clusterctl #3595

Closed superbrothers closed 4 years ago

superbrothers commented 4 years ago

User Story

As a developer/user/operator, I would like to use bash/zsh auto completion for clusterctl for improving work efficiency.

Detailed Description

I'd like to use bash/zsh auto completion for clusterctl command, like kubectl completion command.

$ source <(clusterctl completion bash)

I believe this will improve the experience for everyone - developers/users/operators.

Anything else you would like to add:

None

/kind feature

superbrothers commented 4 years ago

Auto completion of the kubectl command is provided by spf13/cobra library, and clusterctl also uses that library, so it can be provided easily.

I propose offering features in the next step:

  1. Providing auto completion for subcommands and flags
    • Implementation of clusterctl completion bash/zsh command
  2. Providing dynamic auto completion for cluster-api objects
    • Such as cluster object name completion for clusterctl get kubeconfig command

If you like this feature, I'll try to implement it.

fabriziopandini commented 4 years ago

Personally I'm +1 for 1 as a first step

superbrothers commented 4 years ago

/assign

vincepri commented 4 years ago

/milestone v0.4.0

Setting v0.4 as milestone for now, if it's a small enough change we can definitely backport this given that it could be useful

wfernandes commented 4 years ago

/area clusterctl