yls | yfilter 'mdate = yesterday && permissions.oread = true' | yformat -ls
Basically, I wanted to build a couple of standard tools inspired by the FP world, like filter, sort, map, fold (reduce) and have an universal tool for outputting formatted data in whatever form is desired - be it JSON, csv files, text files or custom formats. Every tool would support an -f parameter, which means that its output is automatically piped through the format tool, so that something like
yls | yformat -ls
yls | yformat -csv
yls | yfold '+ size' 0
yls | ymap 'name = name + .jpg' | ymv
ycontacts | yfilter -fcsv 'name = *John*'
yps | yfilter 'name = java*' | yeval 'kill name'
The cool thing about this is that this approach conserves one of the main selling points of FP: composability. I.e. you can throw something like yfold '+ size' 0 in a shell script and then write:
yls | size.sh