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 doesn't recognize curl options. #2750

Closed
nkback opened this issue Apr 29, 2024 · 2 comments · Fixed by #2757
Closed

hurlfmt doesn't recognize curl options. #2750

nkback opened this issue Apr 29, 2024 · 2 comments · Fixed by #2757
Labels
enhancement New feature or request
Milestone

Comments

@nkback
Copy link

nkback commented Apr 29, 2024

I absolutely love the package. Great work on what you've built!

What is the current bug behavior?

hurlfmt --in curl doesn't recognize some curl parameters. (i.e. --url)

Steps to reproduce

  1. Create example.txt file with the following curl: curl --request GET --url https://google.com
  2. Run hurlfmt --in curl example.txt
  3. See the error output:
Can not parse curl command at line 1: error: unexpected argument '--url' found

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

Usage: curl --request <METHOD> [url]

For more information, try '--help'.

What is the expected correct behavior?

The curl --url parameter should be accepted and the corresponding hurl should output.

Hurl Version (hurl --version):

hurl 4.3.0 (x86_64-apple-darwin23.0) libcurl/8.1.2 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.55.1
Features (libcurl):  alt-svc AsynchDNS HSTS HTTP2 IPv6 Largefile libz NTLM NTLM_WB SPNEGO SSL UnixSockets
Features (built-in): brotli

Possible fixes

Haven't had a chance to dive into the code yet, and not sure what other curl options aren't accepted, if any, but hopefully this isn't too intense of a fix. Happy to help anyway I can.

Thanks in advance!

@nkback nkback added the bug Something isn't working label Apr 29, 2024
@fabricereix
Copy link
Collaborator

fabricereix commented Apr 30, 2024

Thanks @nkback for your issue.
we will support it for the next release.

curl --url https://google.fr
will be simply converted to
GET https://google.fr

@nkback
Copy link
Author

nkback commented Apr 30, 2024

@fabricereix thanks for the quick reply here!

@jcamiel jcamiel added enhancement New feature or request and removed bug Something isn't working labels Apr 30, 2024
@jcamiel jcamiel added this to the 5.0.0 milestone Apr 30, 2024
@fabricereix fabricereix linked a pull request May 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants