3 ms·
Obligatory "thanks for fish shell". Try just using line-delimited JSON objects (http://jsonlines.org/ http://jsonlines.org/). It ticks all of your boxes, espec
by orf 7y ago
Obligatory "thanks for fish shell".
Try just using line-delimited JSON objects (http://jsonlines.org/ http://jsonlines.org/). It ticks all of your boxes, especially 3: "jq -s '.cmd' fish_history | histogram".
Neither YAML or Protobufs are quite as easy as that.
All in all it's ridiculously simple, easy to parse in a variety of languages and each row is a single line that's simple to iteratively parse without loading the whole thing into memory.
- keithnz 7y agothis seems like it makes json useful for logging, but not too useful as configuration. For instance, it doesn't support commenting, and it seems like every line needs to have all its children compressed onto one line?
- orf 7y agoIndeed, it's not suitable for configuration. But we are talking about logging shell history, not configuring it.