Cli.usage_rest: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 5291-5301 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=5291&end_line=5301 import Base # Usage wraps between elements and continues at column 7. def usage_rest(elems: List<&2, Segment>, +w: Nat, +col: Nat) -> List<&2, Segment>: match elems: case Nil{}: Nil{} case Segment{+text, styles} <> tail: +ew = width(text) +fits = Nat.is_le((col + 1n + ew : Nat), w) plain(Bool.pick(String, fits, " ", "\n ")) <> Segment{text, styles} <> usage_rest(tail, w, Bool.pick(Nat, fits, (col + 1n + ew : Nat), (7n + ew : Nat))) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Segment https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=plain https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=width