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 #582

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 hubble 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 ⌨️ area/cli Impacts the command line interface of any command in the repository. release-note/misc This PR makes changes that have no direct user impact. breaking-change Breaks compatibility with previous versions labels Jul 2, 2021
@rolinh rolinh requested a review from a team July 2, 2021 08:20
@rolinh rolinh requested a review from a team as a code owner July 2, 2021 08:20
@rolinh rolinh requested review from glibsm and aanm and removed request for a team July 2, 2021 08:21
Copy link
Member

@glibsm glibsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@rolinh rolinh force-pushed the pr/rolinh/cobra-completion branch from f1545f4 to feb0a12 Compare July 2, 2021 17:37
@rolinh rolinh changed the title Update cobra to v1.2.0 and use built-in completion command Update cobra to v1.2.1 and use built-in completion command Jul 2, 2021
@rolinh rolinh added release-note/minor This PR introduces functionality that users may find relevant to operating Hubble. and removed release-note/misc This PR makes changes that have no direct user impact. labels Jul 2, 2021
This new release of cobra improves completion support.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
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 `hubble 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 <robin.hahling@gw-computing.net>
@rolinh rolinh force-pushed the pr/rolinh/cobra-completion branch from feb0a12 to 775c0c2 Compare July 5, 2021 07:47
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jul 5, 2021
@rolinh rolinh merged commit b63a887 into master Jul 5, 2021
@rolinh rolinh deleted the pr/rolinh/cobra-completion branch July 5, 2021 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌨️ area/cli Impacts the command line interface of any command in the repository. breaking-change Breaks compatibility with previous versions ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR introduces functionality that users may find relevant to operating Hubble.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants