Cli.help_page: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 5635-5656 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=5635&end_line=5656 import Base def help_page(view: View, +long: Bool, +w: Nat) -> List<&2, Segment>: match view: case View{path, +about, +items, +globals, root, stuck}: +args = List.append(&2, Item, items, globals) join_blocks(List.concat(&2, List<&2, Segment>, [ text_block(shown_text(long, about), w), [usage_block(usage_elems(path, items, globals), w)], sections_blocks(List.append(&2, Section, [ Section{"Commands", List.append(&2, Row, command_rows(items), help_sub_row(has_sub_item(items)))}, Section{"Arguments", positional_rows(items, long)}, Section{"Options", List.concat(&2, Row, [ option_rows(args, long, ""), [builtin_row(Maybe.is_some(&2, OptFound, find_option(args, "-h")), "-h", "--help", help_text(Bool.or(String.contains(about, "\n\n"), args_paragraphs(args)), long))], version_row(Bool.and(root, has_version_item(items)), args), ])}, ], heading_sections(heading_titles(args, []), args, long)), w), examples_block(example_lines(items)), text_block(String.join(after_texts(items), "\n\n"), w), ])) Uses (38): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.concat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe.is_some https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.contains https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.join 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=OptFound https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Row https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Section 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=View https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=after_texts https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=args_paragraphs https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=builtin_row https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=command_rows https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=example_lines https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=examples_block https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=find_option https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=has_sub_item https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=has_version_item https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=heading_sections https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=heading_titles https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=help_sub_row https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=help_text https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=join_blocks https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=option_rows https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=positional_rows https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=sections_blocks https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=shown_text https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=text_block https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=usage_block https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=usage_elems https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=version_row