hurl
hurl copied to clipboard
zsh and bash completion
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 ?
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).
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
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.
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
+1 for generating and committing the static files for completion.
Some examples:
- zoxide, Rust, +13,000 stars => https://github.com/ajeetdsouza/zoxide/tree/main/contrib/completions
- dust, Rust, +7,000 stars => https://github.com/bootandy/dust/tree/master/completions
- Fossil => https://fossil-scm.org/home/dir?ci=trunk&name=tools see fossil-autocomplete*
And also how curl is generating its completion files