The idea occurred to me late at night, and I don’t know why this has taken so long to happen:
$ jo time=$(date +%s)dir=$HOME{"time":1457195712,"dir":"/Users/jpm"}
Bam! Jo tries to be clever about types and knows null, booleans, strings and numbers. It does arrays, and it pretty-prints on demand:
$ jo -p-a spring summer winter
["spring",
"summer",
"winter"]
Inspired by [Wayback/Archive] a comment on HN, I added another hack: if a key’s value begins with an opening brace ({) or a bracket ([]) we attempt to decode JSON from it; this allows jo to add objects or arrays (use -a!) to itself. Watch:
Leave a comment