You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[16:23:31 trentm@danger0:~/tm/json (master)]
$ cat foo.json
{"foo":"bar"}
{"foo":"bar"}
{asdf}
{"foo":"bar"}
{qwer}
{"foo":"bar"}
[16:23:40 trentm@danger0:~/tm/json (master)]
$ cat foo.json | json -a foo
json: error: input is not JSON: Syntax error at line 2, column 1:
{"foo":"bar"}
^
{"foo":"bar"}
{"foo":"bar"}
{asdf}
{"foo":"bar"}
{qwer}
{"foo":"bar"}
json here will print the error to stderr, and then the full content of the file to stdout. If the file is large, it is way too easy to miss the error that can be the hint to know to use -g.
One idea is to move that stderr to the end of the output to make it harder to miss.
Other ideas welcome too.
The text was updated successfully, but these errors were encountered:
@davepacheco mentioned that if we do the work to allow json to skip non-JSON lines in streaming mode, it "would be nice if it emitted errors for each bad line, but you still got all the other output".
For example:
json
here will print the error to stderr, and then the full content of the file to stdout. If the file is large, it is way too easy to miss the error that can be the hint to know to use-g
.One idea is to move that stderr to the end of the output to make it harder to miss.
Other ideas welcome too.
The text was updated successfully, but these errors were encountered: