jsdelivr / globalping-cli

A simple CLI tool to run networking commands remotely from hundreds of globally distributed servers
Mozilla Public License 2.0
118 stars 14 forks source link

--ci doesnt work properly? #94

Closed jimaek closed 5 months ago

jimaek commented 6 months ago

The --ci option in theory needs to wait for the output to be fully ready before showing it, but it seems to work incorrectly.

How it works:

globalping ping 1.1.1.1  --latency --limit 3 --packets 5 --ci | less
> EU, PL, Warsaw, ASN:12876, SCALEWAY S.A.S.
> EU, AT, Graz, ASN:57169, EDIS GmbH
> EU, BG, Sofia, ASN:57169, EDIS GmbH
Min: 0.621 ms
Max: 0.862 ms
Avg: 0.684 ms

Min: 3.707 ms
Max: 3.969 ms
Avg: 3.807 ms

Min: 0.46 ms
Max: 0.696 ms
Avg: 0.553 ms

Expected output:

> EU, NL, Dronten, ASN:41608, NextGenWebs, S.L.
Min: 2.346 ms
Max: 2.423 ms
Avg: 2.376 ms

> AS, KR, Seoul, ASN:20473, The Constant Company, LLC
Min: 1.478 ms
Max: 1.541 ms
Avg: 1.511 ms

> NA, US, (GA), Atlanta, ASN:18792, Meme Holdings LLC
Min: 5.865 ms
Max: 5.915 ms
Avg: 5.885 ms
jimaek commented 5 months ago

@radulucut can you please look into this? I am writing some scripts and its a blocker

radulucut commented 5 months ago

@jimaek this was fixed in 62672e56784953bbca2a4f6fdb0bed4535b7e257 . Can you have a look and let me know if it is still an issue?

jimaek commented 5 months ago

Seems to work, thank you. I will release master into prod tomorrow

radulucut commented 1 month ago

Adding this for future reference:

This issue is unrelated to the --ci flag. It is (was) caused by outputting the location info into stderr and the rest of the output into stdout.

MartinKolarik commented 1 month ago

Or rather - incorrect use of piping.