def short_of.val

shake@0.7.0.0 · src/cli.bend:272

import shake@0.7.0.0/src/cli.bend as Cli
import Base

272# the value glued after a short letter: what follows one `=` when the rest
273# starts with it (possibly empty, as `--name=` is), else the rest when there
274# is any
275def short_of.val(eq: Bool, +rest: String) -> Maybe<&2, String>:
276  match eq:
277    case True{}:
278      Some{String.drop(rest, 1n)}
279    case False{}:
280      Bool.pick(Maybe<&2, String>, String.is_empty(rest), None{}, Some{rest})

Uses (6)

Used by (1)