json 2 "-a" output is wrong if requested key doesn't exist in one of the items #23

Closed
trentm opened this Issue Oct 25, 2011 · 1 comment

Projects

None yet

1 participant

@trentm
Owner
trentm commented Oct 25, 2011

Get this:

$ echo '[{"a":1}, {"a":2, "b":3}]' | bin/json -a a
1
2
$ echo '[{"a":1}, {"a":2, "b":3}]' | bin/json -a a b
1 2 3
$ echo '[{"a":1}, {"a":2, "b":3}]' | bin/json -a a b -d,
1,2,3

Want this:

$ echo '[{"a":1}, {"a":2, "b":3}]' | bin/json -a a
1
2
$ echo '[{"a":1}, {"a":2, "b":3}]' | bin/json -a a b
1 
2 3
$ echo '[{"a":1}, {"a":2, "b":3}]' | bin/json -d, -a a b
1,
2,3
@trentm
Owner
trentm commented Oct 25, 2011

json 2.0.1

[master f43c627] [issue#23] Fix output in '-a|--array' mode if one or more keys don't exist in one or more of the array items.

@trentm trentm closed this Oct 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment