$ wsta -I ws://example.com | jq .
parse error: Invalid numeric literal at line 1, column 13
Connected to ws://example.com/
thread '<unnamed>' panicked at 'failed printing to stdout: Broken pipe (os error 32)', ../src/libstd/io/stdio.rs:617
note: Run with `RUST_BACKTRACE=1` for a backtrace.
This happens because -I prints headers, which jq cannot parse. jq then exits, breaking the pipe.
The problem is twofold, both of which should be adressed:
[x] To be as pipe-friendly as possible, wsta should only write content the user would want to pipe into stdout.
[x] Handle breaking pipes with a better error message
For a user, this is confusing:
This happens because
-I
prints headers, whichjq
cannot parse.jq
then exits, breaking the pipe.The problem is twofold, both of which should be adressed:
wsta
should only write content the user would want to pipe into stdout.