4 ms·
I’m trying to think about what kind of tools would benefit from such an option… An obvious first tool would be “ls” to produce an easier to parse output. From
by mbreese 3y ago
I’m trying to think about what kind of tools would benefit from such an option…
An obvious first tool would be “ls” to produce an easier to parse output. From there, maybe a “grep” to search fields and “sort” to sort by fields.
I guess I can think of many consumers or YAML-like data, but what would some of the producers be?
- jampekka 3y agols is a good example. Getting the -l output would be very useful for many applications. And would simplify ls itself (e.g. sorting could be done in a separate generig util, which would work with other tools as well). Would also take care of the whitespace horrors. Many tools don't have "stable CLI interface", which makes them difficult to automate. Apt and git come to mind immediately (although git generally allows specifying formats). Some tools (e.g. ffprobe) support JSON output, which provides very easy "bindings" for it (the actual libav APIs are quite painful).