aakso / ssh-inscribe

SSH CA Client/Server
Apache License 2.0
56 stars 11 forks source link

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

Closed scop closed 1 year ago

scop commented 2 years ago

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 https://github.com/spf13/cobra/issues/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 commented 2 years ago

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 commented 2 years ago

upgraded cobra to 1.5.0

scop commented 2 years ago

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

scop commented 1 year ago

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