Why Sponsor Oils? | source | all docs for version 0.24.0 | all versions | oilshell.org
BYO is a simple mechanism to turn CLI processes into "servers" which respond to requests encoded in environment variables.
Points of reference:
(About the name: It originally stood for Bash YSH OSH. But "bring your own" is a good acronym!)
Executables should respond to the BYO_COMMAND
environment variable:
BYO_COMMAND=foo
And BYO_ARG=bar
varies based on the command.
A library that implements this is:
source $LIB_OSH/byo-server.sh
But it's designed to be implemented in Python, C++, etc.
A client is:
test/byo-client.sh detect myscript.sh
Here's how you detect if an executable supports BYO:
$ BYO_COMMAND=detect ./any-executable </dev/null
list-tests
run-tests
# must exit with code 66, which is ASCII 'B'
List tests first:
BYO_COMMAND=list-tests
Then run them one at a time:
BYO_COMMAND=run-test
BYO_ARG=foo
TODO:
BYO_COMMAND=list-tasks # related to task-five
BYO_COMMAND=list-flags # only some binaries have flags
The tool should work like this:
$ byo detect myscript.sh
$ byo test myscript.sh
(Right now it's test/byo-client.sh)
Runtime:
Points of reference:
Instead of a fresh process env variables, we might want to detect coprocesses.