func-e icon indicating copy to clipboard operation
func-e copied to clipboard

Introduce CLI completion to getenvoy

Open musaprg opened this issue 4 years ago • 4 comments

Currently, we have to exec getenvoy fetch to know which version is available before executing getenvoy run. It is a small but actual pain for me. It would be nice to introduce CLI completion (bash-like or zsh-like) to getenvoy, especially getenvoy run. For instance, getenvoy can complete available "flavors" when typed "tab" after getenvoy run.

GetEnvoy uses https://github.com/spf13/cobra, which has a way to generate CLI completion for some popular shells (bash, zsh, fish, PowerShell) ^1. It could be done with it.

musaprg avatar Mar 03 '21 11:03 musaprg

I have personally found cobra very clunky. I wonder what you think about this? https://github.com/urfave/cli/blob/master/docs/v2/manual.md

codefromthecrypt avatar Apr 16 '21 11:04 codefromthecrypt

should be easy to get off cobra now

codefromthecrypt avatar May 07 '21 05:05 codefromthecrypt

@musaprg @llinder either of you want to try this after #218? here's an example project that bundles auto-completion https://github.com/rliebz/tusk

codefromthecrypt avatar May 19 '21 05:05 codefromthecrypt

I'm going to deprioritize this for now though someone else can grab it.

Note that auto-completion of built-in commands is usually easier and different than auto-completion of dynamic args (ex envoy versions). In each case, how to install is somewhat shell specific, so testing this well is a fair amount of work unless we punt and assume things just work.

codefromthecrypt avatar Jun 02 '21 04:06 codefromthecrypt