Cli.zsh_script: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 7005-7023 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=7005&end_line=7023 import Base def zsh_script(+name: String, +items: List<&2, Item>) -> String: +lists = place_lists(all_places(items), []) +id = String.append("_", ident(name)) text_lines(List.concat(&2, String, [ [String.append("#compdef ", name), "", String.append(id, "() {"), " local curcontext=$curcontext state line"], zsh_arrays(lists), zsh_cmd(items, [], lists, name, [], zsh_arms(items, global_items(items), lists, name, [], " "), " "), ["}", "", String.concat(["if [[ $funcstack[1] == ", Sh.quote(String.append("_", name)), " ]]; then"]), String.concat([" ", id, " \"$@\""]), "else", String.concat([" compdef ", id, " ", Sh.quote(name)]), "fi"], ])) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.concat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.concat https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Item https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Sh.quote https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=all_places https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=global_items https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=ident https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=place_lists https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=text_lines https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=zsh_arms https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=zsh_arrays https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=zsh_cmd