3 ms·
Exactly. Now I have a question: Are there such things as shell meta commands? For example, if I try to run some CLI thing called `foo`, the shell (or a shell
by jamesbritt 14y ago
Exactly.
Now I have a question: Are there such things as shell meta commands?
For example, if I try to run some CLI thing called `foo`, the shell (or a shell wrapper) first looks to see if the complete invocation has an argument `--json` and if so converts the actually executed command to
foo | some-json-formatter "foo"
Basically, can a shell rewrite a command-line call, and how hackable is this?
If so then one could write a script that catalogs assorted other CLI apps and runs a formatter for the things it knows about, avoiding having to add yet another feature to countless existing CLI programs.