Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cobra to v1.2.1 and use built-in completion command #392

Merged
merged 2 commits into from
Jul 5, 2021

Conversation

rolinh
Copy link
Member

@rolinh rolinh commented Jul 2, 2021

Since the release of cobra v1.2.0, a completion command is automatically
created if none is provided. We therefore do not need to ship our own
anymore.

Note that this means two breaking changes:

  • Calling cilium completion without specifying a shell name now leads
    to printing out the help message for the command. Our implementation
    used to generate completion for bash. I think that, although breaking,
    this change is for the better.
  • We used to support ps1 as an alias for powershell and the builtin
    subcommand does not.

What we get is more uniformity for our users. Most CLI tools using cobra
are likely to use the built-in command to generate shell completion
rather than rolling their own.

@rolinh rolinh added the kind/feature New feature or request label Jul 2, 2021
@rolinh rolinh requested review from a team as code owners July 2, 2021 17:57
@rolinh rolinh requested review from twpayne and tklauser July 2, 2021 17:57
@rolinh rolinh force-pushed the pr/rolinh/cobra-completion branch from 5afc4d5 to 9fad46d Compare July 2, 2021 17:57
@rolinh rolinh temporarily deployed to ci July 2, 2021 17:58 Inactive
@tklauser tklauser force-pushed the pr/rolinh/cobra-completion branch from 9fad46d to 931fb09 Compare July 5, 2021 09:32
@tklauser tklauser temporarily deployed to ci July 5, 2021 09:32 Inactive
@tklauser
Copy link
Member

tklauser commented Jul 5, 2021

Rebased to pick up #394 fixing the EKS workflows.

This new release of cobra improves completion support.

Signed-off-by: Robin Hahling <[email protected]>
Since the release of cobra v1.2.0, a completion command is automatically
created if none is provided. We therefore do not need to ship our own
anymore.

Note that this means two breaking changes:

- Calling `cilium completion` without specifying a shell name no leads
  to printing out the help message for the command. Our implementation
  used to generate completion for bash. I think that, although breaking,
  this change is for the better.
- We used to support `ps1` as an alias for `powershell` and the builtin
  subcommand does not.

What we get is more uniformity for our users. Most CLI tools using cobra
are likely to use the built-in command to generate shell completion
rather than rolling their own.

Signed-off-by: Robin Hahling <[email protected]>
@tklauser tklauser force-pushed the pr/rolinh/cobra-completion branch from 931fb09 to 65b3d5e Compare July 5, 2021 11:50
@tklauser tklauser temporarily deployed to ci July 5, 2021 11:50 Inactive
@tklauser
Copy link
Member

tklauser commented Jul 5, 2021

@tklauser tklauser merged commit 71306ef into master Jul 5, 2021
@tklauser tklauser deleted the pr/rolinh/cobra-completion branch July 5, 2021 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants