This is indeed annoying, but you should probably just embrace stderr as stdNonPipeOutput and call it a day.
One of my workarounds for utility scripts is to go waaaaaaaay overboard and output results and log output as JSON-per-line. The upside of this is that I can pipe the output to jq and crack out what I want. Should command line utility scripts be spraying JSON? Probably not, but it's worked into my toolchains now. I've written worse...
One of my workarounds for utility scripts is to go waaaaaaaay overboard and output results and log output as JSON-per-line. The upside of this is that I can pipe the output to jq and crack out what I want. Should command line utility scripts be spraying JSON? Probably not, but it's worked into my toolchains now. I've written worse...