def bash_slot_cases
cli@0.2.0.0 · cli.bend:6568
import cli@0.2.0.0/cli.bend as Cli
import Base
6568def bash_slot_cases(slots: List<&2, Slot>) -> List<&2, String>:
6569 match slots:
6570 case Nil{}: Nil{}
6571 case Slot{k, False{}, required, many, rest, ph, Words{list, values}} <> tail:
6572 String.concat([" ", Nat.show(k), ") ",
6573 bash_kind(Words{list, values}, False{}), " ;;"]) <> bash_slot_cases(tail)
6574 case Slot{k, False{}, required, many, rest, ph, Files{}} <> tail:
6575 String.concat([" ", Nat.show(k), ") kind=f ;;"]) <> bash_slot_cases(tail)
6576 case Slot{k, False{}, required, many, rest, ph, Dirs{}} <> tail:
6577 String.concat([" ", Nat.show(k), ") kind=d ;;"]) <> bash_slot_cases(tail)
6578 case head <> tail: bash_slot_cases(tail)