Re:Varlink – A plain-text, type-safe, discoverable, self-doc...
by 1_player on Sunday September 15, 2019 @04:32AM
(#20976198)
The shell can't speak HTTP either, but all OSes ship with a command line HTTP client. My point is that in 2019 JSON is such a common format _most_ people have or should have a JSON client encoder/decoder installed in their /bin, though I'm not sure any OS ships with any by default.
To be fair, I have jq installed and I have no idea how to use it.
Re:Varlink – A plain-text, type-safe, discoverable, self-doc...
by Spivak on Sunday September 15, 2019 @08:46AM
(#20976978)
I really love the jq language but I totally agree that the complexity skyrockets once you peek at the 'advanced' features because this neat little query language turns into a full programming language with io, variables, modules, functions. Very similar to AWK.
If you want something that is just a good query language then I would highly recommend JMESPath. It's a little harder to grok initially but the spec is extremely detailed, comes with examples, and there's libraries for all the 'popular' programming languages.
A good CLI tool that wraps the Go library is https://github.com/jmespath/jp
Why do people say things like this? The only format unix shell can reliably understand is tab-separated value.