Closed MartinKolarik closed 2 weeks ago
It also seems like a good idea to refactor the handling of colored output. Right now, we have conditions like this all over the place:
if r.ctx.CIMode {
r.printer.Printf("> %s\n", e.Message)
} else {
r.printer.Printf(r.printer.Color("> "+e.Message, view.ColorLightYellow) + "\n")
}
It seems easy to forget. Would be better if the Color
function had a required bool param like useColor
and would simply return the original string when called with false
.
@MartinKolarik, outputting to stderr will cause this behaviour: #94, are we ok with that?
Wouldn't make more sense to have a separate flag for this, i.e. --noInfo
?
Do you mean it'll cause issues specifically with less
or with the CI mode or piping in general?
with less
(and piping in general, it happens with more
, head
...), it's unrelated to CI mode
Ok, I see. I most likely misunderstood that issue back then since the description said CI, and you didn't really describe the changes in the fix... I'll check this a little later.
@radulucut let's do this. It seems the previous behavior was in line with the idea from https://github.com/jsdelivr/globalping-cli/issues/56#issue-1685200265, and the other issue was just a misunderstanding.
It seems that through some refactoring, we lost changes from #55 and #56. Let's restore them. Things that should go to
stderr
:>
(location info, share links, ...)This infinite ping will consume 1 API credit for every 16 packets until stopped.
message from #114http --full
command (as in #55).