src/run/bend.bend relies on unsafe/foreign
raw source on the hub · import 0x886223f5c47e4983fe57d887c034bc7f/src/run/bend.bend as Bend
run/bend: which bend is on the PATH, asked the way that bend will answer.
bend has had the question two ways round. Up to 2.0.16 it is bend --version
and bend version is "no such file: version"; from 2.0.18 on it is bend
version and the flag is "unknown option --version". Either way the spelling
it does not know exits non-zero, which looks exactly like a bend that is not
installed — so a caller that asks only one way cannot tell a missing bend
from an old one, and ez has two callers that need the banner: doctor's
report and the toolchain part of a cache key.
Asking both ways, current spelling first, is the whole of this module.
2 imports
import Base import 0xabe575924687afad4cee1a2c1194d639/main.bend as R
Definitions
def version.older source · line 15 · raw
@ok:Bool -> @out:String -> IO(String)
the older spelling, tried only when the current one was not understood
def version source · line 25 · raw
IO(String)
bend asked which bend it is, as a run's answer: the status line, then the
banner. A bend that is not on the PATH fails both spellings, so the status
an absent bend answers with is still the one the caller sees.