Most of the operations do not map any json to json, so you cant pipe them. The whole design principle of the unix command line tools is that they all map lines to lines so anything is composable.
So for json I would want a structure match corresponding to grep, filter and map operations, merges etc each of which maps valid json to valid json.
Almost half* of the commands map json (stdin) to json (stdout). Extract, modify and insert all take and spit out json. Originally (when it only supported single commands) this is how you had to do everything. But that much piping is a real drag. Anyway, show me a shell json util that is more composable or at least provide a suggestion to improving it :-)
Grep/filter/map are all stuff you do in the shell, after using Jshon to extract the data from the hard-to-parse-safely json.
*The remaining commands are concessions to make line-oriented shell processing easier.
Comments
> the Jshon ones do not really seem to compose properly.
Could you elaborate on that a bit?
Most of the operations do not map any json to json, so you cant pipe them. The whole design principle of the unix command line tools is that they all map lines to lines so anything is composable.
So for json I would want a structure match corresponding to grep, filter and map operations, merges etc each of which maps valid json to valid json.
Almost half* of the commands map json (stdin) to json (stdout). Extract, modify and insert all take and spit out json. Originally (when it only supported single commands) this is how you had to do everything. But that much piping is a real drag. Anyway, show me a shell json util that is more composable or at least provide a suggestion to improving it :-)
Grep/filter/map are all stuff you do in the shell, after using Jshon to extract the data from the hard-to-parse-safely json.
*The remaining commands are concessions to make line-oriented shell processing easier.