
*nix command line apps should have a –json output flag - tlhunter
http://thomashunter.name/blog/linux-cli-apps-should-have-a-json-flag/
======
rachelbythebay
It seems like someone who runs enough pings to warrant this kind of parsing
would be better served writing a service which does nothing but ping stuff.
Then they can use whatever encoding method they want rather than trying to
retrofit such things onto existing tools which are for humans.

It seems people want to wrap things and parse them rather than making the same
basic library calls themselves. Note the "inspiration" part of this post: the
author started parsing the output of iwlist instead of just making the
requisite calls directly.

Oh, and don't derail this with a discussion of suid-ness required for raw
sockets (ping) or whatever magic ioctls that an iwlist-alike would require.
This applies to other things which can run as a normal user, too.

~~~
renownedmedia
Perhaps my biggest shortcoming is not knowing how to make these library calls.
I only write scripted code (node.js, PHP, etc.) and haven't done anything with
binary libraries.

Also, I write a lot of apps which I release under the BSD license, and
generally shy away from touching anyone else's binary libraries for fear of
catching the GPL.

------
rcfox
Or just pipe the output into a filter that outputs the json for you.

~~~
bandy
There's no Job Security in that! You need to rearchitect the entire system to
add in protocol support for the flavor-of-the-moment each time it changes.

~~~
renownedmedia
The article uses JSON as an example, and goes on to say that any data exchange
format would work. XML could become the standard as it is easily converted
into different data storage languages without the need to write output
specific filters.

