def job.fields
import snap@1.4.0.0/src/par.bend as Parimport Base
8# one job's fields on the `par` wire: each argument marked with a `+` in
9# front, then an empty field that ends the job. A marked field is never empty,
10# so the empty one cannot be mistaken for an argument, whatever the arguments
11# hold; and the empty job is the empty field alone.
12def job.fields(argv: List<&2, String>) -> List<&2, String>:
13 match argv:
14 case []:
15 [""]
16 case arg <> rest:
17 ("+" ++ arg) <> job.fields(rest)