enhancement(cli): Shell autocomplete for the Vector CLI#9823
enhancement(cli): Shell autocomplete for the Vector CLI#9823lucperkins wants to merge 5 commits intomasterfrom
Conversation
Signed-off-by: Luc Perkins <luc.perkins@datadoghq.com>
Signed-off-by: Luc Perkins <luc.perkins@datadoghq.com>
Signed-off-by: Luc Perkins <luc.perkins@datadoghq.com>
Signed-off-by: Luc Perkins <luc.perkins@datadoghq.com>
|
✔️ Deploy Preview for vector-project canceled. 🔨 Explore the source changes: a9a2cd2 🔍 Inspect the deploy log: https://app.netlify.com/sites/vector-project/deploys/617ad2c05d367f00088b88a5 |
|
I was just using the VRL shell to file a bug report and was getting so mad of not having TAB-autocompletion, specially when auto-completion is already possible by using the RightArrow key instead of TAB. Thanks so much for this! EDIT: Wait, the RightArrow key is not actually autocompletion... so thanks even more for this! |
|
@hhromic Sadly, I pushed this having only tested Bash and Fish, which worked great, but now I see that Zsh panics with a completely inscrutable error. Sigh. I'll see what I can do, but if this requires an overhaul of our CLI plumbing this may not come through for a while. |
|
@lucperkins apologies, I just realised I completely misunderstood this PR 🤦 You are implementing autocompletion for the For example this sort of thing: (that last one I never remember the exact name so I often have to go look it up in the docs!) |
|
@hhromic Ah yes, this is just for the CLI. Inside the VRL REPL there is only limited completion. I may take a stab at that at some point but I can't say it's high priority at the moment. In the meantime, if you're writing VRL in separate I should also note that in the VRL REPL there are some helper commands that you can see if you run |
|
Closing this for now, as it's unclear when the necessary dependency updates will happen. But I'll keep checking back on that and reopen this when the time comes. |
This adds support for generating autocompletion for different shells for the vector cli. Superseds [vectordotdev#9823](vectordotdev#9823)
* enhancement(cli): Shell autocompletion for vector cli This adds support for generating autocompletion for different shells for the vector cli. Superseds [#9823](#9823) * chore: add changelog * Bump versions * Update changelog * vdev build licenses --------- Co-authored-by: Thomas <thomas.schneider@datadoghq.com>
* enhancement(cli): Shell autocompletion for vector cli This adds support for generating autocompletion for different shells for the vector cli. Superseds [#9823](#9823) * chore: add changelog * Bump versions * Update changelog * vdev build licenses --------- Co-authored-by: Thomas <thomas.schneider@datadoghq.com>
This is currently a draft, as I found out after submitting that attempting to generate zsh completions throws a fatal panic due to an issue in
clap. This has been fixed inclap(see this PR). Those changes have not, however, made it into a non-beta release and thus haven't been yet incorporated intostructopt. Oncestructopthas incorporated those changes, we should be able to push this through without issue; until then, a panic onvector completion zshis likely to surprise and frustrate users, so let's keep this on ice for the time being.