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

--write-out formatted incorrectly #24

Open
bartvanraaij opened this issue Aug 17, 2020 · 0 comments
Open

--write-out formatted incorrectly #24

bartvanraaij opened this issue Aug 17, 2020 · 0 comments

Comments

@bartvanraaij
Copy link

One of my favourite curl features is the ability to display additional info via the --write-out or -w parameter.
More info on this parameter: https://ec.haxx.se/usingcurl/usingcurl-verbose/usingcurl-writeout

I have for example a "template" at ~/.curl-extras with the following contents:

size_request:  %{size_request}b\n
size_download: %{size_download}b\n
time_total:    %{time_total}s\n

This appends additional info (timings and sizes, in this case) to the output, e.g.:

➜ curl "httpbin.org/headers" -w "@$HOME/.curl-extras"  
{
  "headers": {
    "Accept": "*/*", 
    "Host": "httpbin.org", 
    "User-Agent": "curl/7.64.1", 
    "X-Amzn-Trace-Id": "Root=1-5f3a7921-d59081ec96facb5e0d05149c"
  }
}

size_request:  82b
size_download: 173b
time_total:    0.234310s

However, with curlie the newlines are removed and some unexpected colors are applied:

HTTP/1.1 200 OK
Date: Mon, 17 Aug 2020 12:33:39 GMT
Content-Type: application/json
Content-Length: 191
Connection: keep-alive
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true

{
    "headers": {
        "Accept": "application/json, */*",
        "Host": "httpbin.org",
        "User-Agent": "curl/7.64.1",
        "X-Amzn-Trace-Id": "Root=1-5f3a7923-ec04c2802d0278c01cbb1700"
    }
}
size_request: 100bsize_download: 191btime_total: 0.226571s%

Screenshot 2020-08-17 at 15 16 30

Hopefully this is something that can be fixed - though I can imagine this being a challenge as I expect that curlie tries to format all of curls stdout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant