Cli.fault_tips: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 6012-6035 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=6012&end_line=6035 import Base # Every tip that applies, in table order. def fault_tips(fault: ScanFault, +c: Cmd, +path: List<&2, String>, argv: List<&2, String>, here: String, +items: List<&2, Item>, globals: List<&2, Item>) -> List<&2, List<&2, Segment>>: match fault: case E01{+token}: List.concat(&2, List<&2, Segment>, [ long_tips(long_name(token), token, cmd_name(c), path, items, cmd_items(c), here), similar("argument", suggest(token, List.concat(&2, String, [ long_candidates(List.append(&2, Item, items, globals)), ["--help"], Bool.pick(List<&2, String>, Bool.and(List.is_empty(&2, String, path), has_version_item(items)), ["--version"], []), ]))), dash_tip(String.starts_with(token, "-"), token, items, c, argv), ]) case E02{+name}: similar("subcommand", suggest(name, sub_candidates(items))) case E04{+arg, +value, reason}: similar("value", suggest(value, display_choices(List.append(&2, Item, items, globals), arg, []))) case E09{+token}: dash_tip(String.starts_with(token, "-"), token, items, c, argv) case _: Nil{} Uses (23): 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.pick 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=List.is_empty https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.starts_with https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Cmd 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=ScanFault 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=cmd_items https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=cmd_name https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=dash_tip https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=display_choices 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=long_candidates https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=long_name https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=long_tips https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=similar https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=sub_candidates https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=suggest