Error in zsh completion
Steps:
- Create a .hurl file with any request
- cd to the file's location
- type
hurl, then space followed by tab
Expected: I would expect the file name to be completed
Actual:
Error
_arguments:comparguments:327: invalid rest argument definition: *(-H --header)-H[Pass custom header(s) to server]: :
- hurl 6.1.1 (x86_64-apple-darwin24.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.63.0
- Installed via Homebrew
- macOS 15.3.2
Thanks @aresler for reporting the issue. We are going to have a look at it.
@fabricereix haven't we fixed this one? I've the impression we've done it...
@jcamiel Just fyi, the issue is still reproduced for me on hurl 6.1.1, as well as on 7.0.0 built from sources on mac.
For anyone affected, a workaround is to create an alias or function wrapper, e.g. in zsh.rc:
hu() {
hurl $@
}
Yes thanks, we've fixed it for bash but have to do it for zsh completion. We'll ship it with 7.0.0
The completion file is quite tricky to understand. Maybe @zottelsheep, you have an idea? You have updated it a few months back, and you seem more familar with szh completion than us. Thanks
@fabricereix this line in the _hurl zsh completion file seems problematic:
'*(-H --header)'{-H,--header}'[Pass custom header(s) to server]: :' \
It should be:
'(-H --header)*'{-H,--header}'[Pass custom header(s) to server]: :' \
With this modification, the completion works fine
where do you get it from? from a spec? we can "make it work", but I'm not very comfortable not to understand why. At least the file is committed.
the file is generated by bin/spec/options/generate_completion.py
Hi @aresler, the fix has been merged into master. You can test it if you want.