def misplaced_attr_name

cli@0.2.0.0 · cli.bend:1490

import cli@0.2.0.0/cli.bend as Cli
import Base

1490def misplaced_attr_name(attr: Item, +kind: UsageKind) ->
1491    Maybe<&2, String>:
1492  match attr:
1493    case Global{}: bad_attr(kind_pos(kind), "global")
1494    case Rest{}: bad_attr(Bool.not(kind_variadic_pos(kind)), "rest")
1495    case AttrDefault{value}:
1496      bad_attr(Bool.not(kind_default_allowed(kind)), "default")
1497    case Required{}:
1498      bad_attr(Bool.not(kind_required_allowed(kind)), "required")
1499    case Heading{title}: bad_attr(kind_pos(kind), "heading")
1500    case Alias{name}: bad_attr(kind_pos(kind), "alias")
1501    case As{t}: bad_attr(Bool.not(kind_valued(kind)), type_name(t))
1502    case OneOf{values}:
1503      bad_attr(Bool.not(kind_valued(kind)), "one_of")
1504    case Delim{sep}: bad_attr(Bool.not(kind_delim_allowed(kind)), "delim")
1505    case Hyphen{}: bad_attr(Bool.not(kind_valued(kind)), "hyphen")
1506    case Arg{usage, help, items}: Some{"arg"}
1507    case Sub{name, about, items}: Some{"sub"}
1508    case Version{value}: Some{"version"}
1509    case Example{line, what}: Some{"example"}
1510    case After{text}: Some{"after"}
1511    case SubOptional{}: Some{"sub_optional"}
1512    case External{}: Some{"external"}
1513    case Exclusive{group}: Some{"exclusive"}
1514    case NeedOne{group}: Some{"need_one"}
1515    case _: None{}

Uses (13)

Used by (1)