src/share/pass.bend
ezx@1.9.0.0 · 20 lines · 0 definitions
1# share/pass: a program run on ez's own stdin, stdout and stderr, as `cargo run`
2# runs one. Every other program ez starts goes through snap's `exec`, which
3# hands the child /dev/null for stdin, holds what it prints until it exits,
4# and answers both at once; that is what a command that reads the answer
5# wants. `ez run` and `ez tool run` read nothing back: the program talks to
6# the person, and ez only waits for it and exits with its status (`S.code`
7# and `TP.code`, EZ-OUT-1).
8import Base
9import snap@1.3.0.0/main.bend as R
10
11# the program and its arguments, newline separated, run with no shell between
12# and nothing captured. The answer is the status it exited with: 128 plus the
13# signal for one a signal ended, and 127 for one that could not be started.
14def ezpass.run(cmd: String) -> IO(U32):
15 import "./pass.c"
16 import "./pass.js"
17
18# a program run with its arguments, on ez's own stdio
19def run(argv: List<&2, String>) -> IO(U32):
20 ezpass.run(R.cmd(argv))