trentm/json — pull request #64 by AndrewO (2014-02-26 23:41:50+00:00)
Title: Adds --map-hash (-M) option for Hash-like objects

jsontool works very well with arrays and record-like objects with fixed keys.
However, in many cases, the object is being used as a Hash and the keys will not
be known ahead of time. Moreover, we might want to extract and print the key
value in the final lookup results.

This option tells the tool to remap the object as an array of objects with keys
"key" and "value", where "key" is the old key and "value" is the JSON value that
it pointed to.

I'd be happy to add to the docs and help message, but I wanted to run this by you first. If it helps to know where the need for this feature came from, I'm building some command line tools for ElasticSearch and pretty much every call has some kind of hash-style object in it that I want pull into a bash friendly whitespace delimited format.