Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hurlfmt fail to convert curl command with -v option #3760

Open
benkio opened this issue Feb 20, 2025 · 1 comment
Open

hurlfmt fail to convert curl command with -v option #3760

benkio opened this issue Feb 20, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@benkio
Copy link

benkio commented Feb 20, 2025

What is the current bug behavior?

following the #316 and this article
I was exploring the ability of hurlfmt to convert a given curl command to hurl.
The curl command in input has a -v option and that causes hurlfmt to fail.

Steps to reproduce

  • create a file with this curl command: curl -v https://nekos.best/api/v2/hug?amount=2
  • run the command: cat test.curl | hurlfmt --in curl

Output:

bash-5.2$ cat test.curl | hurlfmt --in curl
error: Can not parse curl command at line 1: error: unexpected argument '-v' found

  tip: to pass '-v' as a value, use '-- -v'

Usage: curl [OPTIONS] [url_param]

For more information, try '--help'.

What is the expected correct behavior?

I expect the command to not fail and generate a valid hurl output as without -v option in the input file.

Execution context

  • Hurl Version (hurl --version):
bash-5.2$ hurl --version
hurl 6.0.0 (x86_64-apple-darwin24.2.0) libcurl/8.11.1 OpenSSL/3.3.2 zlib/1.3.1 brotli/brotli/1.1.0 zstd/zstd/1.5.6 libidn2/2.3.7 libssh2/1.11.1 nghttp2/1.64.0
Features (libcurl):  alt-svc AsynchDNS brotli HSTS HTTP2 IDN IPv6 Largefile libz NTLM SPNEGO SSL TLS-SRP UnixSockets zstd
Features (built-in): brotli
@benkio benkio added the bug Something isn't working label Feb 20, 2025
@fabricereix
Copy link
Collaborator

Thanks @benkio for reporting the issue
we should indeed support -v/--verbose option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants