Closed MartinKolarik closed 1 year ago
The output itself doesn't change in this case right?
No, but running globalping http https://cdn.jsdelivr.net/npm --method GET > file
means you only get the second line in the file and the first stays in the terminal.
Note that this makes processing the output easier for the most common --limit 1
scenario, but it's still tricky as soon as there are multiple responses. Some research would be useful to see how other tools handle this problem. Current ideas:
--json | jq
?I believe PR #58 fixes this as the results separator > NA, US ...
now goes to stderr
Related to #55. We currently print the API response itself and some additional information. The extra information should always go to
stderr
. For example:The first line should go to
stderr
and the second tostdout
. This makes it easier to programmatically process just one part of the output and matches how other CLIs work. If someone wants both parts, they can still merge it via2>&1
.