def parse_long_prefixed
cli@0.2.0.0 · cli.bend:1357
import cli@0.2.0.0/cli.bend as Cli
import Base
1357
1358def parse_long_prefixed(s: String, short: String,
1359 repeat: Bool, +start: Nat) -> Usage:
1360 match s:
1361 case SCon{Chr{45}, SCon{Chr{45}, SCon{Chr{91}, SCon{Chr{110},
1362 SCon{Chr{111}, SCon{Chr{45}, SCon{Chr{93}, rest}}}}}}}:
1363 finish_long(scan_name(rest, Nat.add(start, 7n), "", True{},
1364 Nat.add(start, 7n)), short, repeat, True{})
1365 case SCon{Chr{45}, SCon{Chr{45}, rest}}:
1366 finish_long(scan_name(rest, Nat.add(start, 2n), "", True{},
1367 Nat.add(start, 2n)), short, repeat, False{})
1368 case _:
1369 Invalid{start}