hurl icon indicating copy to clipboard operation
hurl copied to clipboard

zsh and bash completion

Open teto opened this issue 1 year ago • 5 comments

Problem to solve

I would like to have zsh and bash completion. Maybe it's already possible and they are not installed by my linux distribution but I had a quick look on this repo and was not sure if this is possible ?

teto avatar Aug 24 '23 14:08 teto

We haven't created a completion file yet. It will be indeed interesting to have one. Similar to the vim syntax file, we could provide it in contrib/ folder. In the long term, it should be packaged with Hurl (in the same package).

fabricereix avatar Aug 31 '23 13:08 fabricereix

not sure what argument parsing library you use but usually these libraries can generate the completion out of the box with something like hurl --zsh-completion > _zsh . Might be worth checking out, if hurl uses something like clap for instance

teto avatar Aug 31 '23 22:08 teto

It surprised me that hurl doesn't support completion. As a reference, here's how mullvad-vpn's CLI creates its shell completions using the crate clap_complete.

mawkler avatar Jan 26 '24 17:01 mawkler

I would tend to prefer compile-time completion rather than runtime-completion. We are going to look at it, to see whether to use clap or using simple Python scripts from our option files https://github.com/Orange-OpenSource/hurl/tree/master/docs/spec/options/hurl

fabricereix avatar Jan 27 '24 17:01 fabricereix