4 ms·
I really enjoy seeing new ideas around interfaces. But I do wonder, rather than creating a new shell, couldn't we have a 'json/structured' mode for cli programs
by chrissoundz 7y ago
I really enjoy seeing new ideas around interfaces. But I do wonder, rather than creating a new shell, couldn't we have a 'json/structured' mode for cli programs - and maintain compatibility with existing shells? For example if it was toggled with a SHELL_FORMAT environment variable?
What issues could be faced with this approach?
- munchbunny 7y agoPowerShell has an IMO good answer to this: if you run a classic CLI program, its output is interpreted as an array of strings (lines), so if you pipe the output, you have a way to process it into something object-like. Having a toggle creates the problem that you have to write two implementations for your tools, or you end up having to memorize which commands can run in which modes. It's easier to have a consistent pattern and a way to up-convert existing CLI programs.
- joshspankit 7y agoOh lordy where to begin.
- joshspankit 7y agoAhh yes. Here’s where to begin: https://xkcd.com/927/ https://xkcd.com/927/
- j88439h84 7y agoMario uses Python objects in pipelines instead of plain text. https://github.com/python-mario/mario https://github.com/python-mario/mario