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

refactor(client): use cobra's builtin completion emitter #21

Merged
merged 1 commit into from May 31, 2023
Merged

refactor(client): use cobra's builtin completion emitter #21

merged 1 commit into from May 31, 2023

Conversation

scop
Copy link
Collaborator

@scop scop commented Apr 27, 2022

Cobra v1.2.0+ contains a default completion emitter, we could make use of it.

However, the default emitter outputs cobra's "V2" completions, which are a lot slower than the traditional ones, see spf13/cobra#1680. This is relevant for example with hostname completions which may return a lot of entries.

In that sense I actually don't recommend merging this yet, until there's some way to address the slowness. So marking as a draft.

@scop
Copy link
Collaborator Author

scop commented Jul 15, 2022

Cobra 1.5.0 addresses the performance issues, see the entries marked with "perf" in the release notes' completion section. This one should be good to go after upgrading to it.

I could submit a PR for that but I suppose with vendoring in use here, it's easier if you can find time to take care of it directly.

@aakso
Copy link
Owner

aakso commented Jul 28, 2022

upgraded cobra to 1.5.0

@scop scop changed the base branch from master to chore/upgrade-cobra-to-1.5.0 July 29, 2022 13:49
@scop scop marked this pull request as ready for review July 29, 2022 13:49
@scop
Copy link
Collaborator Author

scop commented Jul 29, 2022

Rebased on top of chore/upgrade-cobra-to-1.5.0

Cobra v1.2.0+ contains a default completion emitter, make use of it.
@scop
Copy link
Collaborator Author

scop commented May 10, 2023

Rebased on master; with Cobra 1.6.1 there, this should be ready to roll.

@scop scop changed the base branch from chore/upgrade-cobra-to-1.5.0 to master May 31, 2023 12:42
@scop scop merged commit 92458e7 into aakso:master May 31, 2023
@scop scop deleted the refactor/cobra-builtin-completion-emitter branch May 31, 2023 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants