def args.default

shake@0.7.0.0 · src/check.bend:46

import shake@0.7.0.0/src/check.bend as Check
import Base
import shake@0.7.0.0/src/cli.bend as C

46# a default outside a nonempty choices list
47def args.default(
48  dflt: Maybe<&2, String>,
49  +cs: List<&2, String>,
50  +path: List<&2, String>,
51  +name: String
52) -> List<&2, SpecErr>:
53  match dflt:
54    case None{}:
55      []
56    case Some{+vv}:
57      one(Bool.and(Bool.not(List.is_empty(&2, String, cs)), Bool.not(C.allowed.ok(cs, vv))),
58        DefaultNotChoice{path, name, vv})

Uses (9)

Used by (1)