3 ms·
This looks really neat. The demo uses a lot of shell pipes though, needing to type "pastel" out for every processing step. It would be convenient if something
by mkl 7y ago
This looks really neat. The demo uses a lot of shell pipes though, needing to type "pastel" out for every processing step. It would be convenient if something like
pastel random | pastel mix red | pastel lighten 0.2 | pastel format hex
could be written
pastel random mix red lighten 0.2 format hex
(not quite possible, I think) or
pastel random then mix red then lighten 0.2 then format hex
or something.
- ken 7y agoGStreamer uses the argument "!" as a pseudo-"|" so you can build multimedia pipelines without actually using Unix pipelines, or repeating the gst-launch command: https://gstreamer.freedesktop.org/documentation/tutorials/basic/gstreamer-tools.html https://gstreamer.freedesktop.org/documentation/tutorials/ba...
- mkl 7y agoThat would be great. pastel random ! mix red ! lighten 0.2 ! format hex
- ayosec 7y agoI made a wrapper to support this: https://gist.github.com/ayosec/816ccba7a75aba5336db0fe0b9791e4d https://gist.github.com/ayosec/816ccba7a75aba5336db0fe0b9791...
- mstade 7y agoHaving written a large number of CLIs in the past, I've often come across this issue but never had a good solution. This is remarkably simple, elegant, and easily generalized into a CLI framework so it can be implemented with ease. Thank you for sharing this nugget of gold!
- hyperjeff 7y agoEvery shell can make its own version, but here's a wrapper in fish which I named pstl: eval (echo "pastel $argv" | sed 's/ | / | pastel /g') Now you can pstl "random | mix red | lighten 0.2 | format hex"