chec / cli

A command line interface for using the Chec API
https://chec.io
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

Info messages going to stdout #54

Open ComedyTomedy opened 2 years ago

ComedyTomedy commented 2 years ago

Hello! When I login & run

$ chec request GET /v1/products > chec.json

I'm suprised to find the first line of output is - Processing...\n before the JSON data starts.

Shouldn't this be sent to stderr, so my shell redirect produces a valid JSON file?

ComedyTomedy commented 2 years ago

For now I'll pipe through sed '/^- /d' since I'm fairly sure that pattern can't occur in valid JSON anyway :)

ComedyTomedy commented 2 years ago

I now think it's my expectations that are wrong. So maybe consider this a feature request.

When there's an error, the info messages go to stdout and the JSON to stderr (which is the opposite of what I'd expect in a unix tool), but also the JSON is prefixed by " ›" on every line, making it unparseable.

I was assuming the goal was to be able to chec ... | jq ..., which would be useful to me for hacking together a quick data validation script.