~/bend-docscommunity

cli.bend checks

raw source on the hub · import cli@0.2.0.0/cli.bend as Cli

Purpose: pure command definitions, validation, and text rendering for Bend CLIs. Expected output: ALL PROOFS CHECK. Run: bend cli.bend --check-only

1 import
import Base

Types

type Style source · line 7 · raw

Data

type Segment source · line 18 · raw

Data

type StripState source · line 71 · raw

Data

type CodeRange source · line 114 · raw

Data

type CodeClass source · line 869 · raw

Data

What a code point can do in an emoji sequence (UTS #51): start a keycap (#, * and 0-9), be a pictograph, a skin tone, a ZWJ or VS16, or none.

type EmojiRun source · line 881 · raw

Data

Where width stands in an emoji sequence: outside one; after an emoji, with the code a skin tone or VS16 applies to, whether it counts 1 so far, and whether a ZWJ may join it; after such a ZWJ; or after a pictograph that a ZWJ joined, which adds nothing.

type WidthStep source · line 887 · raw

Data

type WrapState source · line 1015 · raw

Data

type ValueType source · line 1054 · raw

Data

type Item source · line 1071 · raw

Data

type Cmd source · line 1100 · raw

Data

type Problem source · line 1103 · raw

Data

type UsageKind source · line 1225 · raw

Data

type Usage source · line 1233 · raw

Data

type NameScan source · line 1237 · raw

Data

type PhScan source · line 1242 · raw

Data

PhOK's name is reversed: only a positional's name is read.

type LintItem source · line 1703 · raw

Data

An item as lint walks it: an Arg with its usage parsed once, a Sub with its children's too.

type Seen source · line 1769 · raw

Data

type DecimalState source · line 1941 · raw

Data

type Bad source · line 2014 · raw

Data

The first element of a value that fails to convert, and why.

type Src source · line 2359 · raw

Data

type Var source · line 2365 · raw

Data

type Host source · line 2368 · raw

Data

type Field source · line 2371 · raw

Data

type ScanEvent source · line 2374 · raw

Data

type ScanFault source · line 2383 · raw

Data

type ExternalArgs source · line 2396 · raw

Data

type ScanTrace source · line 2399 · raw

Data

type ParseResult source · line 2404 · raw

Data

type Early source · line 2412 · raw

Data

type Gather source · line 2418 · raw

Data

An arg's hits so far: values holds a repeated option's newest first, so each hit conses, and resolve_argv_gather puts them back in argv order.

type FieldBuild source · line 2421 · raw

Data

type EnvValue source · line 2425 · raw

Data

type ArgInfo source · line 2448 · raw

Data

type OptFound source · line 2452 · raw

Data

type SubFound source · line 2455 · raw

Data

type SubKey source · line 2459 · raw

Data

A subcommand a scope answers to, by name or alias.

type OptKey source · line 2463 · raw

Data

An option name a scope answers to, with the match it makes.

type SpecItem source · line 2467 · raw

Data

An item resolve walks: an Arg with its usage parsed once, or another item.

type Spec source · line 2474 · raw

Data

A scope with each usage parsed once: its option names (own, then global), the items resolve walks (global, then own), its positionals and subcommands, and the globals its subcommands inherit.

type Scope source · line 2480 · raw

Data

type ScanState source · line 2483 · raw

Data

type Tail source · line 2489 · raw

Data

Phases after which no token is an operand and -- is plain.

type Mode source · line 2494 · raw

Data

type SlotTraits source · line 2895 · raw

Data

What the slot that takes the next operand allows: rest(), values that start with "-", and as_f32().

type TokenClass source · line 3549 · raw

Data

How an open scan reads a token: a long token or a dash token (an option, a cluster of short options, or an operand a slot takes), or a word; "-" is a word.

type Fault source · line 4293 · raw

Data

type Matches source · line 4308 · raw

Data

type Form source · line 4355 · raw

Data

type Want source · line 4361 · raw

Data

What a reader asks of an arg; Q-static checks it against the spec.

type Program source · line 4672 · raw

Data

A program and its arguments, as Cli.program reads them.

type KeyStep source · line 4808 · raw

Data

How a route key's next word meets an item: not its subcommand, the subcommand of a built-in, the command the key ends at, or a command whose subcommands take the rest (§6.4).

type Term source · line 4985 · raw

Data

type Prescan source · line 5014 · raw

Data

The pre-scan of argv: the last --color value before --, "" for a bare --color before a hyphen token.

type View source · line 5156 · raw

Data

The command at the longest valid prefix of a path, with the globals it inherits, root first; stuck once a step names no subcommand.

type Row source · line 5312 · raw

Data

A help row: its left cell, whether it is an option with a short or a long-only option, and its right text.

type Section source · line 5315 · raw

Data

type Scored source · line 5669 · raw

Data

type Shell source · line 6135 · raw

Data

type Place source · line 6227 · raw

Data

A command on a visible path, in pre-order from the root: the words of its path below the root, its items, and the globals it inherits, root first.

type Comp source · line 6250 · raw

Data

What a value completes to: a word of the one_of list numbered list, a file, a directory, or nothing.

type Opt source · line 6258 · raw

Data

An option as a script offers it: its names, shorts first, its kind, its placeholder, what its value completes to, and its help on one line.

type Slot source · line 6263 · raw

Data

A positional slot, numbered from 1.

type Entry source · line 6268 · raw

Data

A visible subcommand: its name, its names with aliases, and its summary.

type Stop source · line 6457 · raw

Data

What a script needs at a place: its number, its words, its options in scope, own first, the built-ins, its visible subcommands, and its slots.

type Outcome source · line 7629 · raw

Data

type Linted source · line 7703 · raw

Data

A Cmd that passed lint, from linted: eval_linted skips the lint eval runs.

type Step source · line 7723 · raw

@-A:Type -> Type

type Ran source · line 7863 · raw

Data

What a run prints and how it ends: its exit status, its stdout text and its stderr text.

type Utf8Lead source · line 7912 · raw

Data

What a byte starts: no UTF-8 sequence (a continuation byte, C0, C1, F5 to FF, or a value past 255), or one with more continuation bytes, the code point bits the byte carries, and the least code point a sequence that long may hold, below which it is overlong.

type ArgChar source · line 7955 · raw

Data

A char decoded from argument bytes, and how many bytes after its first it took.

Definitions

def style_code source · line 21 · raw

@style:Style -> String

def style_codes_tail source · line 33 · raw

@styles:List<&2, Style> -> String

def style_codes source · line 39 · raw

@styles:List<&2, Style> -> String

def paint source · line 45 · raw

@on:Bool -> @styles:List<&2, Style> -> @text:String -> String

def emit_go source · line 56 · raw

@segments:List<&2, Segment> -> @+on:Bool -> String

def emit source · line 65 · raw

@on:Bool -> @segments:List<&2, Segment> -> String

def sgr_body_char source · line 68 · raw

@+c:Char -> Bool

def strip_go source · line 76 · raw

@s:String -> @state:StripState -> String

def strip source · line 111 · raw

@s:String -> String

def contains_range source · line 117 · raw

@ranges:List<&2, CodeRange> -> @+code:U32 -> Bool

def unicode_is_wide source · line 127 · raw

@code:U32 -> Bool

Unicode 15.1 East Asian Wide and Fullwidth ranges, including reserved ranges. Source: https://www.unicode.org/Public/15.1.0/ucd/EastAsianWidth.txt

def unicode_is_zero_mark source · line 253 · raw

@code:U32 -> Bool

Unicode 15.1 nonspacing and enclosing mark ranges (Mn and Me). Source: https://www.unicode.org/Public/15.1.0/ucd/UnicodeData.txt

def unicode_is_pictographic source · line 602 · raw

@code:U32 -> Bool

Unicode 15.1 Extended_Pictographic ranges, including reserved ranges. Source: https://www.unicode.org/Public/15.1.0/ucd/emoji/emoji-data.txt

def unicode_takes_tone source · line 686 · raw

@code:U32 -> Bool

Unicode 15.1 Emoji_Modifier_Base ranges: the emoji a skin tone modifies. Source: https://www.unicode.org/Public/15.1.0/ucd/emoji/emoji-data.txt

def unicode_widens_with_vs16 source · line 734 · raw

@code:U32 -> Bool

Unicode 15.1 code points with an emoji presentation sequence (VS16) that are not East Asian Wide or Fullwidth, so VS16 widens them to 2. Sources: https://www.unicode.org/Public/15.1.0/ucd/emoji/emoji-variation-sequences.txt and https://www.unicode.org/Public/15.1.0/ucd/EastAsianWidth.txt

def code_width_by source · line 853 · raw

@small:Bool -> @+code:U32 -> Nat

A code point's own width: controls, marks, 200B-200F and tag characters (E0000-E007F) are 0, East Asian Wide and Fullwidth are 2, the rest 1.

def code_width source · line 864 · raw

@+code:U32 -> Nat

def keycap_base source · line 890 · raw

@+code:U32 -> Bool

def picto_class source · line 896 · raw

@may:Bool -> @+code:U32 -> CodeClass

may: whether code is in 203C-3299 or from 1F000, which hold every pictograph from 768 on.

def code_class_by source · line 903 · raw

@small:Bool -> @+code:U32 -> CodeClass

def code_class source · line 917 · raw

@+code:U32 -> CodeClass

def picto_alone source · line 920 · raw

@+wide:Bool -> @code:U32 -> WidthStep

def picto_step source · line 925 · raw

@run:EmojiRun -> @+code:U32 -> WidthStep

A pictograph after a ZWJ joins the sequence; any other starts an emoji.

def tone_on source · line 935 · raw

@takes:Bool -> @narrow:Bool -> @join:Bool -> @code:U32 -> WidthStep

A skin tone after an emoji that takes one widens it to 2; any other is 2 wide alone, as East Asian Wide.

def tone_on_joined source · line 942 · raw

@takes:Bool -> @code:U32 -> WidthStep

def tone_step source · line 947 · raw

@run:EmojiRun -> @code:U32 -> WidthStep

def joiner_run source · line 957 · raw

@run:EmojiRun -> EmojiRun

A ZWJ after an emoji that may join, or after a joined pictograph, waits for the next pictograph.

def vs16_widen source · line 965 · raw

@widens:Bool -> @code:U32 -> @join:Bool -> WidthStep

def vs16_on source · line 970 · raw

@narrow:Bool -> @+code:U32 -> @join:Bool -> WidthStep

def vs16_step source · line 976 · raw

@run:EmojiRun -> WidthStep

VS16 widens a 1-wide emoji with an emoji presentation to 2, once.

def code_step source · line 983 · raw

@cls:CodeClass -> @run:EmojiRun -> @code:U32 -> WidthStep

def width_go source · line 993 · raw

@s:String -> @step:WidthStep -> @acc:Nat -> Nat

acc, plus the width of step, the last code point's, and of s after it.

def width source · line 1004 · raw

@s:String -> Nat

Display columns, as Rust's unicode-width 0.2 counts them: each code point's own width, except that an emoji sequence is one cell 2 wide. A pictograph that a ZWJ joins, a skin tone after an emoji that takes one, and tag characters add nothing; VS16 widens a 1-wide emoji to 2.

def leading_indent source · line 1007 · raw

@s:String -> String

def wrap_words source · line 1019 · raw

@words:List<&2, String> -> @state:WrapState -> String

def words source · line 1034 · raw

@s:String -> List<&2, String>

def wrap_line source · line 1038 · raw

@+line:String -> @cols:Nat -> String

def wrap_lines source · line 1044 · raw

@lines:List<&2, String> -> @+cols:Nat -> List<&2, String>

def wrap source · line 1051 · raw

@text:String -> @cols:Nat -> String

def type_name source · line 1062 · raw

@t:ValueType -> String

def cmd source · line 1119 · raw

@name:String -> @about:String -> @items:List<&2, Item> -> Cmd

def sub source · line 1122 · raw

@name:String -> @about:String -> @items:List<&2, Item> -> Item

def arg source · line 1125 · raw

@usage:String -> @help:String -> @items:List<&2, Item> -> Item

def version source · line 1128 · raw

@value:String -> Item

def alias source · line 1131 · raw

@name:String -> Item

def hidden source · line 1134 · raw

Item

def example source · line 1137 · raw

@line:String -> @what:String -> Item

def after source · line 1140 · raw

@text:String -> Item

def sub_optional source · line 1143 · raw

Item

def external source · line 1146 · raw

Item

def exclusive source · line 1149 · raw

@group:String -> Item

def need_one source · line 1152 · raw

@group:String -> Item

def id source · line 1155 · raw

@value:String -> Item

def required source · line 1158 · raw

Item

def default source · line 1161 · raw

@value:String -> Item

def env source · line 1164 · raw

@name:String -> Item

def global source · line 1167 · raw

Item

def heading source · line 1170 · raw

@title:String -> Item

def as_nat source · line 1173 · raw

Item

def as_u32 source · line 1176 · raw

Item

def as_f32 source · line 1179 · raw

Item

def as_bool source · line 1182 · raw

Item

def as_file source · line 1185 · raw

Item

def as_dir source · line 1188 · raw

Item

def one_of source · line 1191 · raw

@values:List<&2, String> -> Item

def delim source · line 1194 · raw

@sep:Char -> Item

def hyphen source · line 1197 · raw

Item

def rest source · line 1200 · raw

Item

def bare source · line 1203 · raw

@value:String -> Item

def conflicts source · line 1206 · raw

@target:String -> Item

def requires source · line 1209 · raw

@target:String -> Item

def group source · line 1212 · raw

@name:String -> Item

def color source · line 1215 · raw

Item

def completions source · line 1219 · raw

Item

Builtin{} marks the subcommands that only eval acts on (§6.4).

def man source · line 1222 · raw

Item

def name_start source · line 1246 · raw

@+c:Char -> Bool

def name_char source · line 1249 · raw

@+c:Char -> Bool

def finish_name source · line 1254 · raw

@rev:String -> @rest:String -> @+pos:Nat -> @+first:Bool -> @+dot_start:Nat -> NameScan

rev is the name so far, reversed.

def scan_name source · line 1260 · raw

@s:String -> @+pos:Nat -> @rev:String -> @+first:Bool -> @dot_start:Nat -> NameScan

def ph_stop source · line 1278 · raw

@at_close:Bool -> @rev:String -> @rest:String -> @+pos:Nat -> PhScan

A placeholder ends at a character no name holds: at close after a name, else with an error there.

def scan_ph source · line 1285 · raw

@s:String -> @+pos:Nat -> @rev:String -> @+close:Char -> PhScan

The placeholder name in s up to close, reversed in rev. A name holds no space, '<', '>', '[', ']' or '=', and close is one of them.

def finish_pos source · line 1296 · raw

@found:PhScan -> @kind:UsageKind -> Usage

def parse_pos source · line 1305 · raw

@s:String -> @+repeat:Bool -> Usage

def finish_required_value source · line 1316 · raw

@found:PhScan -> @id:String -> @short:String -> @long:String -> @kind:UsageKind -> Usage

def finish_optional_value source · line 1326 · raw

@found:PhScan -> @id:String -> @short:String -> @long:String -> Usage

def finish_long source · line 1336 · raw

@found:NameScan -> @short:String -> @+repeat:Bool -> @+negatable:Bool -> Usage

def parse_long_prefixed source · line 1358 · raw

@s:String -> @short:String -> @repeat:Bool -> @+start:Nat -> Usage

A long name after "--[no-]" or "--", at column start.

def parse_short_tail source · line 1371 · raw

@tail:String -> @+short:String -> @+repeat:Bool -> Usage

def parse_short source · line 1388 · raw

@s:String -> @repeat:Bool -> Usage

def parse_usage_body source · line 1397 · raw

@s:String -> @+repeat:Bool -> Usage

def ends_in_ellipsis source · line 1411 · raw

@s:String -> @run:Nat -> Bool

Whether s ends in "...": run counts the dots just before s.

def parse_usage_repeated source · line 1417 · raw

@repeated:Bool -> @+usage:String -> Usage

def parse_usage source · line 1424 · raw

@+usage:String -> Usage

def alias_valid_result source · line 1427 · raw

@parsed:Usage -> @+raw:String -> Bool

def valid_arg_alias source · line 1433 · raw

@+raw:String -> Bool

def kind_pos source · line 1436 · raw

@kind:UsageKind -> Bool

def kind_optional_pos source · line 1441 · raw

@kind:UsageKind -> Bool

def kind_variadic_pos source · line 1446 · raw

@kind:UsageKind -> Bool

def kind_required_pos source · line 1451 · raw

@kind:UsageKind -> Bool

def kind_valued source · line 1456 · raw

@kind:UsageKind -> Bool

def kind_bare source · line 1463 · raw

@kind:UsageKind -> Bool

def kind_default_allowed source · line 1468 · raw

@kind:UsageKind -> Bool

def kind_required_allowed source · line 1476 · raw

@kind:UsageKind -> Bool

def kind_delim_allowed source · line 1481 · raw

@kind:UsageKind -> Bool

def bad_attr source · line 1487 · raw

@cond:Bool -> @name:String -> Maybe<&2, String>

def misplaced_attr_name source · line 1490 · raw

@attr:Item -> @+kind:UsageKind -> Maybe<&2, String>

def maybe_misplaced source · line 1517 · raw

@found:Maybe<&2, String> -> @at:String -> List<&2, Problem>

def placement_issues source · line 1523 · raw

@attrs:List<&2, Item> -> @+kind:UsageKind -> @+at:String -> List<&2, Problem>

def value_type_names source · line 1532 · raw

@attrs:List<&2, Item> -> List<&2, String>

def extra_type_issues source · line 1538 · raw

@names:List<&2, String> -> @+at:String -> List<&2, Problem>

def duplicate_type_issues source · line 1545 · raw

@names:List<&2, String> -> @at:String -> List<&2, Problem>

def command_attr_name source · line 1551 · raw

@attr:Item -> @root:Bool -> Maybe<&2, String>

def has_rest source · line 1581 · raw

@items:List<&2, Item> -> Bool

def has_hidden source · line 1587 · raw

@items:List<&2, Item> -> Bool

def has_builtin source · line 1593 · raw

@items:List<&2, Item> -> Bool

def has_bare source · line 1599 · raw

@items:List<&2, Item> -> Bool

def has_required source · line 1605 · raw

@items:List<&2, Item> -> Bool

def duplicate_strings source · line 1611 · raw

@xs:List<&2, String> -> Bool

def bad_choices source · line 1618 · raw

@items:List<&2, Item> -> Bool

def find_default source · line 1626 · raw

@items:List<&2, Item> -> Maybe<&2, String>

def find_delim source · line 1632 · raw

@attrs:List<&2, Item> -> Maybe<&2, Char>

def split_each source · line 1638 · raw

@values:List<&2, String> -> @+sep:Char -> List<&2, String>

def apply_delim source · line 1646 · raw

@found:Maybe<&2, Char> -> @values:List<&2, String> -> List<&2, String>

def find_id source · line 1652 · raw

@items:List<&2, Item> -> Maybe<&2, String>

def find_requires source · line 1658 · raw

@items:List<&2, Item> -> List<&2, String>

def find_conflicts source · line 1664 · raw

@items:List<&2, Item> -> List<&2, String>

def find_group_attrs source · line 1670 · raw

@items:List<&2, Item> -> List<&2, String>

def find_aliases source · line 1676 · raw

@items:List<&2, Item> -> List<&2, String>

def scope_groups source · line 1682 · raw

@items:List<&2, Item> -> List<&2, String>

def scope_group_rules source · line 1689 · raw

@items:List<&2, Item> -> List<&2, String>

def lint_items source · line 1709 · raw

@items:List<&2, Item> -> List<&2, LintItem>

def has_pos_item source · line 1718 · raw

@items:List<&2, LintItem> -> Bool

def has_sub_item source · line 1725 · raw

@items:List<&2, Item> -> Bool

def has_version_item source · line 1731 · raw

@items:List<&2, Item> -> Bool

def name_scan_valid source · line 1737 · raw

@result:NameScan -> Bool

def valid_command_name source · line 1742 · raw

@s:String -> Bool

def use_id source · line 1745 · raw

@found:Maybe<&2, String> -> @derived:String -> String

def usage_id source · line 1750 · raw

@parsed:Usage -> @attrs:List<&2, Item> -> String

def scope_ids source · line 1757 · raw

@items:List<&2, LintItem> -> List<&2, String>

def same_go source · line 1777 · raw

@a:String -> @b:String -> @same:Bool -> Bool

String.eq, without rebuilding both strings to hand them back; the walk stops at the first difference.

def same_text source · line 1783 · raw

@a:String -> @b:String -> Bool

def same_nonempty source · line 1786 · raw

@+a:String -> @b:String -> Bool

def arg_collision source · line 1789 · raw

@seen:List<&2, Seen> -> @+id:String -> @+short:String -> @+long:String -> Maybe<&2, String>

def sub_collision source · line 1808 · raw

@seen:List<&2, Seen> -> @+name:String -> Bool

def arg_alias_collision source · line 1819 · raw

@seen:List<&2, Seen> -> @+name:String -> Bool

def maybe_dup source · line 1830 · raw

@found:Maybe<&2, String> -> @at:String -> List<&2, Problem>

def when_problem source · line 1835 · raw

@cond:Bool -> @problem:Problem -> List<&2, Problem>

def arg_alias_issue source · line 1838 · raw

@+name:String -> @+at:String -> @seen:List<&2, Seen> -> @version:Bool -> List<&2, Problem>

def arg_alias_issues source · line 1847 · raw

@aliases:List<&2, String> -> @+at:String -> @+seen:List<&2, Seen> -> @+version:Bool -> List<&2, Problem>

def arg_alias_entries source · line 1856 · raw

@aliases:List<&2, String> -> List<&2, Seen>

def arg_entries source · line 1862 · raw

@parsed:Usage -> @+attrs:List<&2, Item> -> List<&2, Seen>

def has_global source · line 1870 · raw

@items:List<&2, Item> -> Bool

def global_entries source · line 1876 · raw

@items:List<&2, LintItem> -> List<&2, Seen>

def sub_alias_issue source · line 1886 · raw

@+name:String -> @+at:String -> @seen:List<&2, Seen> -> List<&2, Problem>

def sub_alias_issues source · line 1894 · raw

@aliases:List<&2, String> -> @+at:String -> @+seen:List<&2, Seen> -> List<&2, Problem>

def sub_alias_entries source · line 1903 · raw

@aliases:List<&2, String> -> List<&2, Seen>

def missing_refs source · line 1909 · raw

@targets:List<&2, String> -> @+ids:List<&2, String> -> @+at:String -> List<&2, Problem>

def valid_u32 source · line 1920 · raw

@s:String -> Bool

A U32 value is what U32.read reads (P22).

def decimal_digits source · line 1924 · raw

@s:String -> Bool

Decimal digits by Nat.read's own test, which Char.is_digit agrees with.

def valid_nat source · line 1932 · raw

@+s:String -> Bool

A Nat value is what Nat.read reads (P22): digits that, less leading zeroes, fit under its cap of 2^48-1.

def valid_bool source · line 1936 · raw

@s:String -> Bool

def is_exponent source · line 1953 · raw

@+c:Char -> Bool

def is_sign source · line 1956 · raw

@+c:Char -> Bool

def decimal_step source · line 1959 · raw

@state:DecimalState -> @+c:Char -> DecimalState

def decimal_accept source · line 1990 · raw

@state:DecimalState -> Bool

def decimal_scan source · line 1998 · raw

@s:String -> @state:DecimalState -> Bool

def valid_f32 source · line 2004 · raw

@s:String -> Bool

def find_one_of source · line 2007 · raw

@items:List<&2, Item> -> Maybe<&2, List<&2, String>>

def find_as source · line 2017 · raw

@attrs:List<&2, Item> -> Maybe<&2, ValueType>

def type_reason source · line 2023 · raw

@kind:ValueType -> @value:String -> Maybe<&2, String>

def quoted_choices source · line 2040 · raw

@values:List<&2, String> -> List<&2, String>

def choices_reason source · line 2046 · raw

@values:List<&2, String> -> String

def choice_reason source · line 2050 · raw

@found:Maybe<&2, List<&2, String>> -> @value:String -> Maybe<&2, String>

def reason_from_type source · line 2059 · raw

@found:Maybe<&2, ValueType> -> @value:String -> Maybe<&2, String>

def first_reason source · line 2065 · raw

@found:Maybe<&2, String> -> @other:Maybe<&2, String> -> Maybe<&2, String>

def value_reason source · line 2071 · raw

@+attrs:List<&2, Item> -> @+value:String -> Maybe<&2, String>

def bad_value source · line 2076 · raw

@reason:Maybe<&2, String> -> @value:String -> Maybe<&2, Bad>

def first_bad source · line 2082 · raw

@values:List<&2, String> -> @+attrs:List<&2, Item> -> Maybe<&2, Bad>

def split_bad source · line 2090 · raw

@found:Maybe<&2, Char> -> @attrs:List<&2, Item> -> @+value:String -> Maybe<&2, Bad>

def value_bad source · line 2097 · raw

@+attrs:List<&2, Item> -> @value:String -> Maybe<&2, Bad>

A delimited value splits first; the first element that fails (§8.2).

def value_issue source · line 2101 · raw

@kind:UsageKind -> @attrs:List<&2, Item> -> @+value:String -> Maybe<&2, Bad>

A value from env or a default converts each element on its own (§8.2).

def bad_default source · line 2109 · raw

@required:Bool -> @issue:Maybe<&2, Bad> -> @value:String -> @id:String -> @at:String -> List<&2, Problem>

def check_default source · line 2116 · raw

@found:Maybe<&2, String> -> @kind:UsageKind -> @+attrs:List<&2, Item> -> @id:String -> @at:String -> List<&2, Problem>

def choice_bad source · line 2126 · raw

@values:List<&2, String> -> @+found:Maybe<&2, ValueType> -> @bad:Maybe<&2, Bad> -> Maybe<&2, Bad>

The first choice the arg's type rejects; after a hit it only walks the rest.

def bad_choice source · line 2134 · raw

@found:Maybe<&2, Bad> -> @id:String -> @at:String -> List<&2, Problem>

def check_choices source · line 2142 · raw

@found:Maybe<&2, List<&2, String>> -> @kind:Maybe<&2, ValueType> -> @id:String -> @at:String -> List<&2, Problem>

Parse checks a value's type before its choices, so a choice the type rejects could never be given.

def positional_issue source · line 2148 · raw

@+kind:UsageKind -> @+id:String -> @attrs:List<&2, Item> -> @rest_items:List<&2, LintItem> -> @+seen_optional:Bool -> @+seen_variadic:Bool -> @+at:String -> List<&2, Problem>

def bare_issue source · line 2165 · raw

@+kind:UsageKind -> @id:String -> @short:String -> @+attrs:List<&2, Item> -> @at:String -> List<&2, Problem>

def misplaced_arg source · line 2174 · raw

@+kind:UsageKind -> @+attrs:List<&2, Item> -> @+at:String -> List<&2, Problem>

def arg_reserved_dup source · line 2179 · raw

@+at:String -> @+long:String -> @seen:List<&2, Seen> -> @id:String -> @short:String -> @version:Bool -> List<&2, Problem>

def arg_issues source · line 2186 · raw

@+kind:UsageKind -> @+id:String -> @+short:String -> @+long:String -> @usage:String -> @help:String -> @+attrs:List<&2, Item> -> @remaining:List<&2, LintItem> -> @+at:String -> @ids:List<&2, String> -> @seen:List<&2, Seen> -> @optional:Bool -> @variadic:Bool -> @version:Bool -> List<&2, Problem>

def arg_problems source · line 2205 · raw

@parsed:Usage -> @+usage:String -> @help:String -> @+attrs:List<&2, Item> -> @remaining:List<&2, LintItem> -> @+at:String -> @ids:List<&2, String> -> @+seen:List<&2, Seen> -> @optional:Bool -> @variadic:Bool -> @+version:Bool -> List<&2, Problem>

def has_external source · line 2223 · raw

@items:List<&2, Item> -> Bool

def has_sub_optional source · line 2229 · raw

@items:List<&2, Item> -> Bool

def needs_sub source · line 2236 · raw

@+items:List<&2, Item> -> Bool

A command that cannot complete without a subcommand (§8.4).

def required_misplaced source · line 2242 · raw

@attrs:List<&2, Item> -> @+at:String -> List<&2, Problem>

Each required() among attrs, as Misplaced at at.

def dead_required_option source · line 2250 · raw

@option:Bool -> @attrs:List<&2, Item> -> @+at:String -> List<&2, Problem>

def dead_required_kind source · line 2258 · raw

@parsed:Usage -> @attrs:List<&2, Item> -> @+at:String -> List<&2, Problem>

An option's required() that descent drops; a flag's or a positional's is already misplaced by its kind.

def dead_required_arg source · line 2265 · raw

@kept:Bool -> @usage:String -> @attrs:List<&2, Item> -> @+at:String -> List<&2, Problem>

def dead_required_items source · line 2271 · raw

@items:List<&2, Item> -> @+at:String -> List<&2, Problem>

def dead_required source · line 2284 · raw

@dead:Bool -> @items:List<&2, Item> -> @+at:String -> List<&2, Problem>

A command that needs a subcommand passes down only its global options' values (§8.4), so another option's required() can never be met.

def command_body_issues source · line 2291 · raw

@+at:String -> @name:String -> @about:String -> @+items:List<&2, Item> -> @has_pos:Bool -> List<&2, Problem>

has_pos: whether items has a positional.

def sub_name_issues source · line 2302 · raw

@+at:String -> @+name:String -> @seen:List<&2, Seen> -> List<&2, Problem>

def lint source · line 2310 · raw

@items:List<&2, LintItem> -> @+at:String -> @+ids:List<&2, String> -> @+seen:List<&2, Seen> -> @+inherited:List<&2, Seen> -> @+optional:Bool -> @+variadic:Bool -> @+version:Bool -> @+root:Bool -> List<&2, Problem>

def problems source · line 2348 · raw

@c:Cmd -> List<&2, Problem>

def host source · line 2428 · raw

@width:Nat -> Host

def host_var source · line 2431 · raw

@h:Host -> @name:String -> @value:String -> Host

def var_value source · line 2436 · raw

@vars:List<&2, Var> -> @+name:String -> Maybe<&2, String>

def host_value source · line 2443 · raw

@h:Host -> @name:String -> Maybe<&2, String>

def arg_info_parsed source · line 2501 · raw

@parsed:Usage -> @usage:String -> @+attrs:List<&2, Item> -> ArgInfo

def arg_info source · line 2510 · raw

@+usage:String -> @attrs:List<&2, Item> -> ArgInfo

def arg_display source · line 2513 · raw

@info:ArgInfo -> String

def short_digit source · line 2520 · raw

@short:String -> Bool

def info_attrs source · line 2525 · raw

@info:ArgInfo -> List<&2, Item>

def info_kind source · line 2529 · raw

@info:ArgInfo -> UsageKind

def info_id source · line 2533 · raw

@info:ArgInfo -> String

def scope_path source · line 2537 · raw

@scope:Scope -> List<&2, String>

def arg_in_group source · line 2541 · raw

@attrs:List<&2, Item> -> @name:String -> Bool

def group_global source · line 2546 · raw

@items:List<&2, Item> -> @+name:String -> Bool

Whether each arg items put in group name is global().

def global_go source · line 2557 · raw

@items:List<&2, Item> -> @+all:List<&2, Item> -> List<&2, Item>

What items pass down to their subcommands, in their order: each global() arg, and each exclusive or need_one rule over a group whose args in all are each global(), so that it holds in every subcommand below.

def global_items source · line 2575 · raw

@+items:List<&2, Item> -> List<&2, Item>

def kind_negatable source · line 2578 · raw

@kind:UsageKind -> Bool

def negated_long source · line 2583 · raw

@long:String -> String

def option_matches source · line 2586 · raw

@+query:String -> @info:ArgInfo -> Maybe<&2, OptFound>

def find_option source · line 2602 · raw

@items:List<&2, Item> -> @+query:String -> Maybe<&2, OptFound>

def key_found source · line 2613 · raw

@key:OptKey -> @query:String -> Maybe<&2, OptFound>

def find_key source · line 2620 · raw

@keys:List<&2, OptKey> -> @+query:String -> @found:Maybe<&2, OptFound> -> Maybe<&2, OptFound>

The first key named query; after a hit it only walks the rest.

def head_named source · line 2629 · raw

@keys:List<&2, OptKey> -> @+query:String -> Bool

Whether keys' first key is named query. It only reads keys, so a walk that asks before it takes a key need not copy the keys it passes.

def key_rank source · line 2637 · raw

@keys:List<&2, OptKey> -> @+query:String -> @at:Nat -> @hit:Bool -> Maybe<&2, Nat>

The position of the first of keys named query, where hit says whether keys' head is and at is its position. It only reads keys: a walk that takes them, as find_key does, copies every field of each key it passes.

def key_found_at source · line 2646 · raw

@key:Maybe<&2, OptKey> -> Maybe<&2, OptFound>

def key_at source · line 2653 · raw

@rank:Maybe<&2, Nat> -> @keys:List<&2, OptKey> -> Maybe<&2, OptFound>

List.get drops each key it passes whole, where a walk over OptKey would open it.

def key_lookup source · line 2660 · raw

@+keys:List<&2, OptKey> -> @+query:String -> Maybe<&2, OptFound>

find_key(keys, query, None{}), copying only the key it finds.

def key_known source · line 2667 · raw

@+keys:List<&2, OptKey> -> @+query:String -> Bool

Whether keys hold one named query, read without copying the key.

def find_option_scope source · line 2672 · raw

@scope:Scope -> @query:String -> Maybe<&2, OptFound>

A scope's own args answer before its globals, as in find_option.

def has_alias source · line 2680 · raw

@items:List<&2, Item> -> @+query:String -> @found:Bool -> Bool

Whether items alias query; after a hit it walks no further.

def alias_hit source · line 2688 · raw

@aliased:Bool -> @name:String -> @children:List<&2, Item> -> Maybe<&2, SubFound>

def sub_hit source · line 2694 · raw

@same:Bool -> @name:String -> @+children:List<&2, Item> -> @query:String -> Maybe<&2, SubFound>

def sub_found source · line 2701 · raw

@item:Item -> @+query:String -> Maybe<&2, SubFound>

def find_sub_go source · line 2708 · raw

@items:List<&2, Item> -> @+query:String -> @found:Maybe<&2, SubFound> -> Maybe<&2, SubFound>

The first Sub named or aliased query; after a hit it walks no further.

def find_sub source · line 2715 · raw

@items:List<&2, Item> -> @+query:String -> Maybe<&2, SubFound>

def positional_items source · line 2719 · raw

@items:List<&2, Item> -> List<&2, Item>

def has_variadic_pos source · line 2729 · raw

@items:List<&2, Item> -> Bool

def positional_can_take source · line 2737 · raw

@items:List<&2, Item> -> @count:Nat -> Bool

def opt_key source · line 2744 · raw

@+name:String -> @info:ArgInfo -> OptKey

name as a key of info; only info's --no- long clears the flag, as in option_matches.

def name_keys source · line 2752 · raw

@names:List<&2, String> -> @+info:ArgInfo -> List<&2, OptKey>

def nonempty_name source · line 2758 · raw

@+name:String -> List<&2, String>

def info_names source · line 2762 · raw

@info:ArgInfo -> List<&2, String>

The names option_matches accepts for info, in its order.

def spec_keys source · line 2772 · raw

@items:List<&2, SpecItem> -> List<&2, OptKey>

def spec_items source · line 2781 · raw

@items:List<&2, Item> -> List<&2, SpecItem>

items less their Subs, each Arg's usage parsed once.

def global_spec source · line 2790 · raw

@items:List<&2, SpecItem> -> @+all:List<&2, Item> -> List<&2, SpecItem>

global_go over items parsed, with all as written.

def spec_slots source · line 2809 · raw

@items:List<&2, SpecItem> -> List<&2, ArgInfo>

def slots_variadic source · line 2818 · raw

@slots:List<&2, ArgInfo> -> Bool

def info_digit_short source · line 2824 · raw

@info:ArgInfo -> Bool

def spec_digit_short source · line 2828 · raw

@items:List<&2, SpecItem> -> Bool

def raw_subs source · line 2835 · raw

@items:List<&2, Item> -> List<&2, SubKey>

def spec_node source · line 2844 · raw

@+items:List<&2, Item> -> @+globals:List<&2, SpecItem> -> Spec

items as a scope inheriting globals; its subcommands stay unparsed until the scan enters one.

def scan_start source · line 2855 · raw

@c:Cmd -> ScanState

def scan_event source · line 2861 · raw

@state:ScanState -> @event:ScanEvent -> ScanState

def first_issue source · line 2868 · raw

@issue:Maybe<&2, ScanFault> -> @fault:ScanFault -> Maybe<&2, ScanFault>

def scan_error source · line 2874 · raw

@state:ScanState -> @fault:ScanFault -> ScanState

def has_hyphen source · line 2881 · raw

@items:List<&2, Item> -> Bool

def has_as_f32 source · line 2887 · raw

@items:List<&2, Item> -> Bool

def slot_here source · line 2900 · raw

@slots:List<&2, ArgInfo> -> @count:Nat -> Bool

Whether slots' first slot takes the operand after count others: it is the count'th, or variadic.

def slot_traits_go source · line 2909 · raw

@slots:List<&2, ArgInfo> -> @count:Nat -> @here:Bool -> SlotTraits

The traits of the first of slots that takes the operand after count others, where here says whether slots' head does. It only reads slots: a walk that returned the slot would copy each of its fields.

def scope_slot_traits source · line 2920 · raw

@scope:Scope -> @+count:Nat -> SlotTraits

def traits_rest source · line 2926 · raw

@traits:SlotTraits -> Bool

def is_negative_number source · line 2930 · raw

@+s:String -> Bool

def before_equal source · line 2933 · raw

@s:String -> String

def after_equal source · line 2939 · raw

@s:String -> Maybe<&2, String>

def first_option_name source · line 2945 · raw

@+token:String -> String

def scope_option_known source · line 2949 · raw

@scope:Scope -> @token:String -> Bool

def scope_builtin_known source · line 2955 · raw

@scope:Scope -> @+token:String -> Bool

def scope_any_option_known source · line 2967 · raw

@+scope:Scope -> @+token:String -> Bool

def scan_operand_ok source · line 2971 · raw

@state:ScanState -> @token:String -> ScanState

def scan_operand_case source · line 2980 · raw

@allowed:Bool -> @state:ScanState -> @token:String -> ScanState

def scope_can_take source · line 2986 · raw

@scope:Scope -> @count:Nat -> Bool

def scan_operand source · line 2992 · raw

@state:ScanState -> @token:String -> ScanState

def spec_inherit source · line 3000 · raw

@spec:Spec -> List<&2, SpecItem>

def event_id source · line 3005 · raw

@event:ScanEvent -> Maybe<&2, String>

def spec_info_found source · line 3012 · raw

@item:SpecItem -> @id:String -> Maybe<&2, ArgInfo>

def find_spec_info source · line 3020 · raw

@items:List<&2, SpecItem> -> @+id:String -> @found:Maybe<&2, ArgInfo> -> Maybe<&2, ArgInfo>

find_arg_info over parsed items; after a hit it only walks the rest.

def event_inherited source · line 3031 · raw

@found:Maybe<&2, String> -> @+globals:List<&2, SpecItem> -> Bool

An arg's hits from before the scan enters a subcommand stay only when the scope being left passes the arg down as a global (SPEC 8.4); operands, entries, help and version stay.

def events_kept source · line 3038 · raw

@keep:Bool -> @event:ScanEvent -> @rest:List<&2, ScanEvent> -> List<&2, ScanEvent>

def events_inherited source · line 3044 · raw

@events:List<&2, ScanEvent> -> @+globals:List<&2, SpecItem> -> List<&2, ScanEvent>

def scan_descend source · line 3052 · raw

@state:ScanState -> @sub:SubKey -> ScanState

def scan_external source · line 3067 · raw

@state:ScanState -> @name:String -> @args:List<&2, String> -> ScanState

def scan_value_result source · line 3076 · raw

@found:Maybe<&2, Bad> -> @state:ScanState -> @info:ArgInfo -> @value:String -> ScanState

E04 quotes the first element that fails.

def scan_value source · line 3086 · raw

@state:ScanState -> @+info:ArgInfo -> @+value:String -> ScanState

def scan_simple_hit source · line 3090 · raw

@state:ScanState -> @info:ArgInfo -> @polarity:Bool -> ScanState

def scan_settle_case source · line 3098 · raw

@resting:Bool -> @issue:Maybe<&2, ScanFault> -> @scope:Scope -> @events:List<&2, ScanEvent> -> @positional_count:Nat -> @external:Maybe<&2, ExternalArgs> -> Mode

def scan_settle source · line 3115 · raw

@state:ScanState -> Mode

def help_flag_case source · line 3122 · raw

@long:Bool -> @short:Bool -> Maybe<&2, Bool>

def help_flag source · line 3129 · raw

@+token:String -> Maybe<&2, Bool>

Which help flag a token is: Some{True{}} for --help, Some{False{}} for -h.

def scan_faulted_case source · line 3132 · raw

@help:Maybe<&2, Bool> -> @state:ScanState -> Tail

def scan_faulted source · line 3137 · raw

@state:ScanState -> @token:String -> Tail

def scope_digit_short source · line 3140 · raw

@scope:Scope -> Bool

def arg_has_hyphen source · line 3145 · raw

@info:ArgInfo -> Bool

def arg_is_f32 source · line 3150 · raw

@info:ArgInfo -> Bool

def fetch_dash_allowed source · line 3156 · raw

@scope:Scope -> @+info:ArgInfo -> @+token:String -> Bool

Whether info's value may be token, which starts with "-".

def fetch_allowed_case source · line 3165 · raw

@dash:Bool -> @scope:Scope -> @info:ArgInfo -> @token:String -> Bool

def fetch_allowed source · line 3171 · raw

@scope:Scope -> @info:ArgInfo -> @+token:String -> Bool

def scan_fetch_result source · line 3174 · raw

@allowed:Bool -> @state:ScanState -> @info:ArgInfo -> @token:String -> Mode

def scan_state_scope source · line 3181 · raw

@state:ScanState -> Scope

def scan_fetch source · line 3186 · raw

@+state:ScanState -> @+info:ArgInfo -> @+token:String -> Mode

def bare_value source · line 3191 · raw

@attrs:List<&2, Item> -> String

def scan_option source · line 3197 · raw

@attached:Maybe<&2, String> -> @state:ScanState -> @info:ArgInfo -> Mode

def info_bare_value source · line 3203 · raw

@info:ArgInfo -> String

def scan_bare_option source · line 3208 · raw

@attached:Maybe<&2, String> -> @state:ScanState -> @+info:ArgInfo -> Mode

def scan_simple_option source · line 3215 · raw

@attached:Maybe<&2, String> -> @state:ScanState -> @info:ArgInfo -> @polarity:Bool -> Mode

def scan_found_kind source · line 3222 · raw

@kind:UsageKind -> @attached:Maybe<&2, String> -> @state:ScanState -> @info:ArgInfo -> @polarity:Bool -> Mode

def scan_found source · line 3238 · raw

@found:OptFound -> @attached:Maybe<&2, String> -> @state:ScanState -> Mode

def scope_version source · line 3244 · raw

@scope:Scope -> Bool

def scan_builtin_hit source · line 3250 · raw

@attached:Maybe<&2, String> -> @state:ScanState -> @event:ScanEvent -> @name:String -> Mode

def traits_hyphen source · line 3256 · raw

@traits:SlotTraits -> Bool

def scan_state_hyphen source · line 3262 · raw

@state:ScanState -> Bool

Whether the slot after state's operands takes hyphen values, as a rest() slot does until it has its first value.

def long_token source · line 3270 · raw

@attached:Maybe<&2, String> -> @name:String -> String

The long token that before_equal and after_equal split into name and attached.

def scan_unknown_long_case source · line 3275 · raw

@hyphen:Bool -> @name:String -> @attached:Maybe<&2, String> -> @state:ScanState -> Mode

def scan_unknown_long source · line 3285 · raw

@name:String -> @attached:Maybe<&2, String> -> @+state:ScanState -> Mode

A long token that names no option, declared or built-in: a value of the next slot if that slot takes hyphen values, else unknown. Only here is the token rebuilt from its name and attached value, so a token that names an option is split once and not kept.

def scan_builtin_other source · line 3289 · raw

@version:Bool -> @name:String -> @attached:Maybe<&2, String> -> @state:ScanState -> Mode

def scan_builtin_long_case source · line 3296 · raw

@help:Bool -> @+name:String -> @attached:Maybe<&2, String> -> @+state:ScanState -> Mode

def scan_builtin_long source · line 3305 · raw

@+name:String -> @attached:Maybe<&2, String> -> @state:ScanState -> Mode

def scan_long_found source · line 3309 · raw

@found:Maybe<&2, OptFound> -> @name:String -> @attached:Maybe<&2, String> -> @state:ScanState -> Mode

def scan_long source · line 3315 · raw

@+token:String -> @+state:ScanState -> Mode

def scan_state_keys source · line 3321 · raw

@state:ScanState -> List<&2, OptKey>

The keys of state's scope.

def find_short_for_head source · line 3327 · raw

@chars:String -> @keys:List<&2, OptKey> -> Maybe<&2, OptFound>

def short_attached source · line 3334 · raw

@chars:String -> String

def scan_short_value_attached source · line 3339 · raw

@value:String -> @state:ScanState -> @info:ArgInfo -> Mode

def scan_short_value source · line 3345 · raw

@chars:String -> @state:ScanState -> @info:ArgInfo -> Mode

def scan_short_bare_value source · line 3349 · raw

@chars:String -> @state:ScanState -> @+info:ArgInfo -> Mode

def scan_short_version source · line 3357 · raw

@enabled:Bool -> @state:ScanState -> Mode

def scan_short_go source · line 3362 · raw

@chars:String -> @+state:ScanState -> @found:Maybe<&2, OptFound> -> Mode

def scan_short source · line 3401 · raw

@+state:ScanState -> @token:String -> Mode

The lookup takes only the scope's keys: an accessor for them would take the state and copy each of its fields.

def scope_external source · line 3410 · raw

@scope:Scope -> Bool

def scope_has_sub source · line 3415 · raw

@scope:Scope -> Bool

def sub_key_aliased source · line 3420 · raw

@aliased:Bool -> @name:String -> @aliases:List<&2, String> -> @children:List<&2, Item> -> Maybe<&2, SubKey>

def sub_key_hit source · line 3426 · raw

@same:Bool -> @name:String -> @+aliases:List<&2, String> -> @children:List<&2, Item> -> @query:String -> Maybe<&2, SubKey>

def sub_key_found source · line 3434 · raw

@key:SubKey -> @+query:String -> Maybe<&2, SubKey>

def find_sub_key source · line 3440 · raw

@subs:List<&2, SubKey> -> @+query:String -> @found:Maybe<&2, SubKey> -> Maybe<&2, SubKey>

find_sub over a scope's subcommands; after a hit it only walks the rest.

def scope_find_sub source · line 3448 · raw

@scope:Scope -> @query:String -> Maybe<&2, SubKey>

def scan_sub_unknown source · line 3454 · raw

@allow_external:Bool -> @state:ScanState -> @token:String -> Mode

def scan_sub_found source · line 3460 · raw

@found:Maybe<&2, SubKey> -> @+state:ScanState -> @token:String -> Mode

def unknown_fault source · line 3468 · raw

@dash:Bool -> @token:String -> ScanFault

def help_missing_case source · line 3473 · raw

@help:Maybe<&2, Bool> -> @+token:String -> @state:ScanState -> Tail

def help_missing source · line 3481 · raw

@+token:String -> @state:ScanState -> Tail

def help_walk source · line 3484 · raw

@found:Maybe<&2, SubKey> -> @state:ScanState -> @token:String -> Tail

def scan_non_option_sub_case source · line 3490 · raw

@help:Bool -> @+token:String -> @+state:ScanState -> Mode

def scan_non_option_sub source · line 3498 · raw

@+token:String -> @state:ScanState -> Mode

def scan_non_option_case source · line 3501 · raw

@has_sub:Bool -> @token:String -> @state:ScanState -> Mode

def scan_non_option source · line 3507 · raw

@token:String -> @+state:ScanState -> Mode

def hyphen_operand source · line 3513 · raw

@hyphen:Bool -> @scope:Scope -> @token:String -> Bool

Whether a slot that takes hyphen values takes a dash token: no option in scope is named by it. The lookup runs only for such a slot, which a rest() slot is until it has its first value.

def f32_operand source · line 3519 · raw

@f32:Bool -> @scope:Scope -> @token:String -> Bool

Whether an f32 slot takes token as a negative number.

def slot_candidate source · line 3525 · raw

@traits:SlotTraits -> @+scope:Scope -> @+token:String -> Bool

def scan_hyphen_candidate source · line 3532 · raw

@state:ScanState -> @+token:String -> Bool

def scan_dash_case source · line 3538 · raw

@operand:Bool -> @token:String -> @state:ScanState -> Mode

def scan_dash_token source · line 3543 · raw

@+token:String -> @+state:ScanState -> Mode

def token_class source · line 3554 · raw

@token:String -> TokenClass

def scan_token_case source · line 3561 · raw

@kind:TokenClass -> @token:String -> @state:ScanState -> Mode

def scan_token source · line 3568 · raw

@+token:String -> @state:ScanState -> Mode

def scan_tail source · line 3571 · raw

@tail:Tail -> @+token:String -> Tail

def scan_open source · line 3580 · raw

@dash:Bool -> @state:ScanState -> @token:String -> Mode

-- ends options only here, while the scan is open (R1).

def scan_go source · line 3586 · raw

@tokens:List<&2, String> -> @mode:Mode -> Mode

An external subcommand takes the rest of argv verbatim.

def scan_tail_close source · line 3600 · raw

@tail:Tail -> ScanState

def scan_close source · line 3606 · raw

@mode:Mode -> ScanState

def scan_trace_of source · line 3614 · raw

@state:ScanState -> @ended:Bool -> ScanTrace

def scan_trace source · line 3623 · raw

@mode:Mode -> ScanTrace

def scan source · line 3628 · raw

@c:Cmd -> @argv:List<&2, String> -> ScanTrace

def find_early source · line 3631 · raw

@events:List<&2, ScanEvent> -> Maybe<&2, Early>

def scope_needs_sub source · line 3638 · raw

@scope:Scope -> Bool

def bool_text source · line 3643 · raw

@value:Bool -> String

def gather_value source · line 3646 · raw

@gather:Gather -> @+value:String -> @many:Bool -> Gather

def gather_flag source · line 3654 · raw

@gather:Gather -> @value:Bool -> Gather

def gather_count source · line 3659 · raw

@gather:Gather -> Gather

def kind_many source · line 3665 · raw

@kind:UsageKind -> Bool

def gather_value_if source · line 3673 · raw

@hit:Bool -> @gather:Gather -> @value:String -> @kind:UsageKind -> Gather

gather with a hit's value, or as it was on a miss: a match, not Bool.pick, so a miss builds nothing.

def gather_flag_if source · line 3679 · raw

@hit:Bool -> @gather:Gather -> @value:Bool -> Gather

def gather_count_if source · line 3684 · raw

@hit:Bool -> @gather:Gather -> Gather

def gather_event source · line 3689 · raw

@event:ScanEvent -> @id:String -> @kind:UsageKind -> @gather:Gather -> Gather

def gather_events source · line 3699 · raw

@events:List<&2, ScanEvent> -> @+id:String -> @+kind:UsageKind -> @gather:Gather -> Gather

def gather_arg source · line 3707 · raw

@events:List<&2, ScanEvent> -> @info:ArgInfo -> Gather

def find_envs source · line 3713 · raw

@attrs:List<&2, Item> -> List<&2, String>

Each env() name, in order.

def env_present source · line 3719 · raw

@name:String -> @found:Maybe<&2, String> -> Maybe<&2, EnvValue>

def env_next source · line 3728 · raw

@found:Maybe<&2, EnvValue> -> @+name:String -> @vars:List<&2, Var> -> Maybe<&2, EnvValue>

found, or else name's value in vars if it is set and not empty.

def env_first source · line 3735 · raw

@names:List<&2, String> -> @found:Maybe<&2, EnvValue> -> @+vars:List<&2, Var> -> Maybe<&2, EnvValue>

found, or else the first of names that is set and not empty in vars.

def host_env source · line 3741 · raw

@h:Host -> @names:List<&2, String> -> Maybe<&2, EnvValue>

def env_bool_true source · line 3746 · raw

@value:String -> Bool

def env_values source · line 3750 · raw

@kind:UsageKind -> @attrs:List<&2, Item> -> @value:String -> List<&2, String>

def resolve_env_valid source · line 3758 · raw

@found:Maybe<&2, Bad> -> @info:ArgInfo -> @name:String -> @value:String -> FieldBuild

def resolve_env source · line 3768 · raw

@+info:ArgInfo -> @env:EnvValue -> FieldBuild

def resolve_default source · line 3774 · raw

@found:Maybe<&2, String> -> @info:ArgInfo -> FieldBuild

def info_default source · line 3783 · raw

@info:ArgInfo -> Maybe<&2, String>

def resolve_env_default source · line 3788 · raw

@found:Maybe<&2, EnvValue> -> @+info:ArgInfo -> FieldBuild

def info_envs source · line 3794 · raw

@info:ArgInfo -> List<&2, String>

def resolve_argv_gather source · line 3799 · raw

@gather:Gather -> @+info:ArgInfo -> @h:Host -> FieldBuild

def resolve_option source · line 3810 · raw

@+info:ArgInfo -> @events:List<&2, ScanEvent> -> @h:Host -> FieldBuild

def scope_arg_items source · line 3814 · raw

@scope:Scope -> List<&2, SpecItem>

def combine_built source · line 3819 · raw

@fields:List<&2, Field> -> @next:FieldBuild -> FieldBuild

def combine_build source · line 3826 · raw

@first:FieldBuild -> @second:FieldBuild -> FieldBuild

def resolve_arg source · line 3832 · raw

@pos:Bool -> @+info:ArgInfo -> @events:List<&2, ScanEvent> -> @h:Host -> @later:FieldBuild -> FieldBuild

def resolve_options source · line 3838 · raw

@items:List<&2, SpecItem> -> @+events:List<&2, ScanEvent> -> @+h:Host -> FieldBuild

def scan_operands source · line 3847 · raw

@events:List<&2, ScanEvent> -> List<&2, String>

def position_take_count source · line 3855 · raw

@kind:UsageKind -> @after:List<&2, ArgInfo> -> @+tokens:List<&2, String> -> Nat

def pos_valid_result source · line 3864 · raw

@found:Maybe<&2, Bad> -> @info:ArgInfo -> @values:List<&2, String> -> FieldBuild

def resolve_pos source · line 3874 · raw

@+info:ArgInfo -> @+values:List<&2, String> -> @h:Host -> FieldBuild

def resolve_positions source · line 3884 · raw

@slots:List<&2, ArgInfo> -> @+tokens:List<&2, String> -> @+h:Host -> FieldBuild

def scope_positions source · line 3894 · raw

@scope:Scope -> List<&2, ArgInfo>

def resolve_scope source · line 3899 · raw

@+scope:Scope -> @+events:List<&2, ScanEvent> -> @+h:Host -> FieldBuild

def source_given source · line 3906 · raw

@source:Src -> Bool

def field_source source · line 3913 · raw

@fields:List<&2, Field> -> @+id:String -> Src

def field_given source · line 3920 · raw

@fields:List<&2, Field> -> @id:String -> Bool

def source_present source · line 3923 · raw

@source:Src -> Bool

def field_present source · line 3928 · raw

@fields:List<&2, Field> -> @id:String -> Bool

def group_usages source · line 3931 · raw

@items:List<&2, Item> -> @+name:String -> List<&2, String>

def spec_group_usages source · line 3941 · raw

@items:List<&2, SpecItem> -> @+name:String -> List<&2, String>

def spec_group_display source · line 3952 · raw

@items:List<&2, SpecItem> -> @name:String -> String

def group_given source · line 3955 · raw

@items:List<&2, SpecItem> -> @+fields:List<&2, Field> -> @+name:String -> Bool

def arg_required_missing source · line 3964 · raw

@info:ArgInfo -> @+fields:List<&2, Field> -> Bool

def group_display source · line 3973 · raw

@items:List<&2, Item> -> @name:String -> String

def missing_arg source · line 3976 · raw

@+info:ArgInfo -> @fields:List<&2, Field> -> List<&2, String>

def missing_group source · line 3982 · raw

@+items:List<&2, SpecItem> -> @fields:List<&2, Field> -> @+name:String -> List<&2, String>

def missing_once source · line 3989 · raw

@listed:Bool -> @items:List<&2, SpecItem> -> @fields:List<&2, Field> -> @name:String -> List<&2, String>

A group's display the first time a need_one rule names it.

def missing_items source · line 3997 · raw

@items:List<&2, SpecItem> -> @+all_items:List<&2, SpecItem> -> @+fields:List<&2, Field> -> @+done:List<&2, String> -> List<&2, String>

What E06 lists, in items' order: each required arg not given, and each need_one group with no arg given that done does not name yet.

def scope_missing source · line 4015 · raw

@scope:Scope -> @fields:List<&2, Field> -> List<&2, String>

def append_new source · line 4020 · raw

@seen:Bool -> @ids:List<&2, String> -> @id:String -> List<&2, String>

def has_text source · line 4028 · raw

@names:List<&2, String> -> @+query:String -> @found:Bool -> Bool

Whether names holds query: List.contains with String.eq would copy each name it compares.

def append_unique source · line 4034 · raw

@+ids:List<&2, String> -> @+id:String -> List<&2, String>

def append_event_id source · line 4038 · raw

@found:Maybe<&2, String> -> @ids:List<&2, String> -> List<&2, String>

def argv_order source · line 4044 · raw

@events:List<&2, ScanEvent> -> @ids:List<&2, String> -> List<&2, String>

def source_env source · line 4051 · raw

@source:Src -> Bool

def env_order source · line 4056 · raw

@fields:List<&2, Field> -> @+ids:List<&2, String> -> List<&2, String>

def present_order source · line 4064 · raw

@events:List<&2, ScanEvent> -> @fields:List<&2, Field> -> List<&2, String>

def arg_info_found source · line 4068 · raw

@item:Item -> @id:String -> Maybe<&2, ArgInfo>

def find_arg_go source · line 4077 · raw

@items:List<&2, Item> -> @+id:String -> @found:Maybe<&2, ArgInfo> -> Maybe<&2, ArgInfo>

The first Arg whose id is id; after a hit it walks no further.

def find_arg_info source · line 4084 · raw

@items:List<&2, Item> -> @+id:String -> Maybe<&2, ArgInfo>

def exclusive_groups source · line 4088 · raw

@items:List<&2, SpecItem> -> List<&2, String>

def common_exclusive source · line 4095 · raw

@groups:List<&2, String> -> @+left:List<&2, String> -> @+right:List<&2, String> -> Bool

def pair_conflicts source · line 4105 · raw

@+later:ArgInfo -> @+earlier:ArgInfo -> @groups:List<&2, String> -> Bool

def pair_fault source · line 4117 · raw

@+later:ArgInfo -> @earlier:Maybe<&2, ArgInfo> -> @groups:List<&2, String> -> Maybe<&2, ScanFault>

def earlier_conflict source · line 4126 · raw

@earlier_ids:List<&2, String> -> @+later:ArgInfo -> @+items:List<&2, SpecItem> -> @+groups:List<&2, String> -> @found:Maybe<&2, ScanFault> -> Maybe<&2, ScanFault>

def conflict_for_id source · line 4138 · raw

@info:Maybe<&2, ArgInfo> -> @seen:List<&2, String> -> @items:List<&2, SpecItem> -> @groups:List<&2, String> -> Maybe<&2, ScanFault>

def conflict_go source · line 4146 · raw

@ids:List<&2, String> -> @+seen:List<&2, String> -> @+items:List<&2, SpecItem> -> @+groups:List<&2, String> -> @found:Maybe<&2, ScanFault> -> Maybe<&2, ScanFault>

def require_target_fault source · line 4160 · raw

@target:Maybe<&2, ArgInfo> -> @+requester:ArgInfo -> @fields:List<&2, Field> -> Maybe<&2, ScanFault>

def require_targets source · line 4171 · raw

@targets:List<&2, String> -> @+requester:ArgInfo -> @+items:List<&2, SpecItem> -> @+fields:List<&2, Field> -> @found:Maybe<&2, ScanFault> -> Maybe<&2, ScanFault>

def require_for_id source · line 4184 · raw

@info:Maybe<&2, ArgInfo> -> @items:List<&2, SpecItem> -> @fields:List<&2, Field> -> Maybe<&2, ScanFault>

def require_go source · line 4193 · raw

@ids:List<&2, String> -> @+items:List<&2, SpecItem> -> @+fields:List<&2, Field> -> @found:Maybe<&2, ScanFault> -> Maybe<&2, ScanFault>

def parse_requires source · line 4204 · raw

@fault:Maybe<&2, ScanFault> -> @path:List<&2, String> -> @fields:List<&2, Field> -> @external:Maybe<&2, ExternalArgs> -> ParseResult

def parse_conflicts source · line 4211 · raw

@fault:Maybe<&2, ScanFault> -> @+scope:Scope -> @+fields:List<&2, Field> -> @events:List<&2, ScanEvent> -> @external:Maybe<&2, ExternalArgs> -> ParseResult

def parse_missing source · line 4223 · raw

@missing:List<&2, String> -> @+scope:Scope -> @+fields:List<&2, Field> -> @+events:List<&2, ScanEvent> -> @empty:Bool -> @external:Maybe<&2, ExternalArgs> -> ParseResult

def parse_built source · line 4237 · raw

@build:FieldBuild -> @+scope:Scope -> @events:List<&2, ScanEvent> -> @empty:Bool -> @external:Maybe<&2, ExternalArgs> -> ParseResult

def parse_no_issue source · line 4246 · raw

@needs_sub:Bool -> @+scope:Scope -> @+events:List<&2, ScanEvent> -> @+h:Host -> @+empty:Bool -> @external:Maybe<&2, ExternalArgs> -> ParseResult

def parse_issue source · line 4255 · raw

@issue:Maybe<&2, ScanFault> -> @+scope:Scope -> @events:List<&2, ScanEvent> -> @h:Host -> @empty:Bool -> @external:Maybe<&2, ExternalArgs> -> ParseResult

def parse_early source · line 4265 · raw

@found:Maybe<&2, Early> -> @+scope:Scope -> @events:List<&2, ScanEvent> -> @h:Host -> @empty:Bool -> @issue:Maybe<&2, ScanFault> -> @external:Maybe<&2, ExternalArgs> -> ParseResult

def parse_from_state source · line 4277 · raw

@state:ScanState -> @h:Host -> @empty:Bool -> ParseResult

def parse source · line 4287 · raw

@c:Cmd -> @h:Host -> @+argv:List<&2, String> -> ParseResult

def Dec source · line 4297 · raw

@-A:Type -> Type

def Dec.pure source · line 4300 · raw

@-A:Type -> @x:A -> Dec(A)

def Dec.bind source · line 4303 · raw

@-A:Type -> @-B:Type -> @r:Dec(A) -> @f:(@_:A -> Dec(B)) -> Dec(B)

def matches source · line 4312 · raw

@c:Cmd -> @r:ParseResult -> Maybe<&2, Matches>

def path source · line 4318 · raw

@m:Matches -> List<&2, String>

def external_args source · line 4322 · raw

@m:Matches -> Maybe<&1, Pair(String, List<&2, String>)>

def fail source · line 4328 · raw

@-A:Type -> @msg:String -> Dec(A)

def bug source · line 4331 · raw

@-A:Type -> @msg:String -> Dec(A)

def keep source · line 4334 · raw

@+m:Matches -> Dec(Matches)

def path_text source · line 4338 · raw

@name:String -> @path:List<&2, String> -> String

A command path as lint writes it: the root name, then each subcommand.

def sub_items source · line 4341 · raw

@found:Maybe<&2, SubFound> -> List<&2, Item>

def scope_args source · line 4347 · raw

@path:List<&2, String> -> @+items:List<&2, Item> -> @globals:List<&2, Item> -> List<&2, Item>

The args in scope at path (§8.1), as parse orders them: globals first.

def kind_flag source · line 4369 · raw

@kind:UsageKind -> Bool

def kind_count source · line 4375 · raw

@kind:UsageKind -> Bool

def type_stem source · line 4381 · raw

@found:Maybe<&2, ValueType> -> String

The reader name a value type reads with: str, nat, u32, f32 or bool.

def stem_noun source · line 4389 · raw

@+stem:String -> String

def stem_article source · line 4392 · raw

@+stem:String -> String

def always_present source · line 4395 · raw

@kind:UsageKind -> @+attrs:List<&2, Item> -> Bool

def may_absent source · line 4399 · raw

@+kind:UsageKind -> @attrs:List<&2, Item> -> Bool

def kind_text source · line 4403 · raw

@kind:UsageKind -> @+stem:String -> String

def fit_name source · line 4413 · raw

@+kind:UsageKind -> @attrs:List<&2, Item> -> @+stem:String -> String

def kind_verdict source · line 4424 · raw

@fits:Bool -> @id:String -> @+kind:UsageKind -> @+attrs:List<&2, Item> -> Maybe<&2, String>

def absent_verdict source · line 4433 · raw

@absent:Bool -> @id:String -> @reader:String -> Maybe<&2, String>

def all_in source · line 4441 · raw

@xs:List<&2, String> -> @+ys:List<&2, String> -> Bool

def keys_issue source · line 4448 · raw

@same:Bool -> @id:String -> Maybe<&2, String>

def keys_verdict source · line 4455 · raw

@found:Maybe<&2, List<&2, String>> -> @+keys:List<&2, String> -> @id:String -> Maybe<&2, String>

def form_fits source · line 4463 · raw

@form:Form -> @many:Bool -> Bool

def form_one source · line 4468 · raw

@form:Form -> Bool

def value_fits source · line 4473 · raw

@stem:String -> @form:Form -> @+kind:UsageKind -> @attrs:List<&2, Item> -> Bool

def choose_fits source · line 4479 · raw

@+kind:UsageKind -> @attrs:List<&2, Item> -> Bool

def program_fits source · line 4484 · raw

@+kind:UsageKind -> @attrs:List<&2, Item> -> Bool

A program and its arguments come from one variadic string positional.

def rest_verdict source · line 4487 · raw

@rest:Bool -> @id:String -> Maybe<&2, String>

def want_verdict source · line 4496 · raw

@want:Want -> @+id:String -> @+kind:UsageKind -> @+attrs:List<&2, Item> -> Maybe<&2, String>

The first Q-static message for an arg in scope: kind, absence, then keys, or for a program, then rest().

def arg_verdict source · line 4525 · raw

@found:Maybe<&2, ArgInfo> -> @id:String -> @name:String -> @path:List<&2, String> -> @want:Want -> Maybe<&2, String>

def verdict source · line 4535 · raw

@cmd:Cmd -> @+path:List<&2, String> -> @+id:String -> @want:Want -> Maybe<&2, String>

Q-static: depends only on the spec, the path, the id and the want.

def field_found source · line 4542 · raw

@f:Field -> @id:String -> Maybe<&2, Field>

def field_seek source · line 4549 · raw

@fields:List<&2, Field> -> @+id:String -> @found:Maybe<&2, Field> -> Field

The field for id, or an absent one; after a hit it walks no further.

def field_find source · line 4556 · raw

@fields:List<&2, Field> -> @+id:String -> Field

def true_of source · line 4592 · raw

@s:String -> Bool

def nat_of source · line 4595 · raw

@s:String -> Nat

def u32_of source · line 4598 · raw

@s:String -> U32

def f32_of source · line 4601 · raw

@s:String -> F32

def flag source · line 4604 · raw

@m:Matches -> @id:String -> Dec(Bool)

def count source · line 4607 · raw

@m:Matches -> @id:String -> Dec(Nat)

def str source · line 4611 · raw

@m:Matches -> @id:String -> Dec(String)

def str_opt source · line 4615 · raw

@m:Matches -> @id:String -> Dec(Maybe<&2, String>)

def strs source · line 4619 · raw

@m:Matches -> @id:String -> Dec(List<&2, String>)

def nat source · line 4623 · raw

@m:Matches -> @id:String -> Dec(Nat)

def nat_opt source · line 4627 · raw

@m:Matches -> @id:String -> Dec(Maybe<&2, Nat>)

def nats source · line 4631 · raw

@m:Matches -> @id:String -> Dec(List<&2, Nat>)

def u32 source · line 4635 · raw

@m:Matches -> @id:String -> Dec(U32)

def u32_opt source · line 4639 · raw

@m:Matches -> @id:String -> Dec(Maybe<&2, U32>)

def u32s source · line 4643 · raw

@m:Matches -> @id:String -> Dec(List<&2, U32>)

def f32 source · line 4647 · raw

@m:Matches -> @id:String -> Dec(F32)

def f32_opt source · line 4651 · raw

@m:Matches -> @id:String -> Dec(Maybe<&2, F32>)

def f32s source · line 4655 · raw

@m:Matches -> @id:String -> Dec(List<&2, F32>)

def bool source · line 4659 · raw

@m:Matches -> @id:String -> Dec(Bool)

def bool_opt source · line 4663 · raw

@m:Matches -> @id:String -> Dec(Maybe<&2, Bool>)

def bools source · line 4667 · raw

@m:Matches -> @id:String -> Dec(List<&2, Bool>)

def program_of source · line 4675 · raw

@values:List<&2, String> -> Program

def program_maybe source · line 4680 · raw

@values:List<&2, String> -> Maybe<&2, Program>

def get_program source · line 4685 · raw

@f:Field -> Program

def get_program_opt source · line 4689 · raw

@f:Field -> Maybe<&2, Program>

def program source · line 4696 · raw

@m:Matches -> @id:String -> Dec(Program)

§6.5: a <COMMAND>... positional with Cli.rest() as a program and its arguments, the first value and the rest, as timeout, nice and env take them: every token after the program is one of its arguments.

def program_opt source · line 4699 · raw

@m:Matches -> @id:String -> Dec(Maybe<&2, Program>)

def field_src source · line 4702 · raw

@f:Field -> Src

def given source · line 4706 · raw

@m:Matches -> @id:String -> Dec(Bool)

def source source · line 4709 · raw

@m:Matches -> @id:String -> Dec(Src)

def by_key_hit source · line 4712 · raw

@-a:Quant -> @-A:Kind(a) -> @same:Bool -> @value:A -> Maybe<a, A>

def find_by_key_go source · line 4718 · raw

@-a:Quant -> @-A:Kind(a) -> @keys:List<&2, String> -> @values:List<a, A> -> @+key:String -> @found:Maybe<a, A> -> Maybe<a, A>

The value under the first key equal to key; after a hit it walks no further.

def find_by_key source · line 4727 · raw

@-a:Quant -> @-A:Kind(a) -> @keys:List<&2, String> -> @values:List<a, A> -> @+key:String -> Maybe<a, A>

def keyed_cons source · line 4731 · raw

@-a:Quant -> @-A:Kind(a) -> @key:String -> @value:A -> @rest:Pair(List<&2, String>, List<a, A>) -> Pair(List<&2, String>, List<a, A>)

def unzip_keyed source · line 4737 · raw

@-a:Quant -> @-A:Kind(a) -> @table:List<&1, Pair(String, A)> -> Pair(List<&2, String>, List<a, A>)

A choose or route table as its keys and its values.

def choice_dec source · line 4746 · raw

@-A:Data -> @found:Maybe<&2, A> -> Dec(Maybe<&2, A>)

After validation the key exists: parse and samples keep one_of values.

def choose_read source · line 4751 · raw

@-A:Data -> @keys:List<&2, String> -> @values:List<&2, A> -> @f:Field -> Dec(Maybe<&2, A>)

def choose_check source · line 4758 · raw

@-A:Data -> @verdict:Maybe<&2, String> -> @keys:List<&2, String> -> @values:List<&2, A> -> @fields:List<&2, Field> -> @id:String -> Dec(Maybe<&2, A>)

def choose_pick source · line 4765 · raw

@-A:Data -> @opt:Bool -> @choices:Pair(List<&2, String>, List<&2, A>) -> @m:Matches -> @+id:String -> Dec(Maybe<&2, A>)

def choose_opt source · line 4774 · raw

@-A:Data -> @m:Matches -> @id:String -> @table:List<&1, Pair(String, A)> -> Dec(Maybe<&2, A>)

def choice_must source · line 4779 · raw

@-A:Data -> @d:Dec(Maybe<&2, A>) -> Dec(A)

After validation a bare choose always has a value.

def choose source · line 4785 · raw

@-A:Data -> @m:Matches -> @id:String -> @table:List<&1, Pair(String, A)> -> Dec(A)

def Call source · line 4789 · raw

@-A:Type -> Type

def word_rest source · line 4795 · raw

@name:String -> @text:String -> @same:Bool -> Maybe<&2, Maybe<&2, String>>

Some{None{}} when text is the word name, Some{Some{rest}} when it is name, a space and rest, None{} otherwise. Words are cut at spaces, so a name with a space (Chr{32}) is no word.

def key_user source · line 4814 · raw

@builtin:Bool -> @rest:Maybe<&2, String> -> KeyStep

def key_word source · line 4820 · raw

@found:Maybe<&2, Maybe<&2, String>> -> @children:List<&2, Item> -> KeyStep

def key_step source · line 4826 · raw

@items:List<&2, Item> -> @text:String -> KeyStep

def key_go source · line 4834 · raw

@items:List<&2, Item> -> @+text:String -> @step:KeyStep -> Bool

The first subcommand named by each word of text, from items down, is a command.

def route_text source · line 4844 · raw

@empty:Bool -> @+key:String -> @+items:List<&2, Item> -> Bool

def route_key source · line 4850 · raw

@+key:String -> @items:List<&2, Item> -> Bool

A route key's words name a command; "" is the root.

def non_command source · line 4853 · raw

@keys:List<&2, String> -> @+items:List<&2, Item> -> Maybe<&2, String>

def route_call source · line 4861 · raw

@-A:Type -> @bad:Maybe<&2, String> -> @call:Call(A) -> @m:Matches -> Dec(A)

def route_found source · line 4869 · raw

@-A:Type -> @found:Maybe<&1, Call(A)> -> @keys:List<&2, String> -> @cmd:Cmd -> @path:List<&2, String> -> @m:Matches -> Dec(A)

No route for the path is checked first, then every key names a command.

def route_pick source · line 4877 · raw

@-A:Type -> @routes:Pair(List<&2, String>, List<&1, Call(A)>) -> @m:Matches -> Dec(A)

def route source · line 4886 · raw

@-A:Type -> @m:Matches -> @table:List<&1, Pair(String, Call(A))> -> Dec(A)

def sample_typed source · line 4891 · raw

@found:Maybe<&2, ValueType> -> String

def sample_choice source · line 4899 · raw

@found:Maybe<&2, List<&2, String>> -> @attrs:List<&2, Item> -> String

def sample_value source · line 4905 · raw

@kind:UsageKind -> @+attrs:List<&2, Item> -> String

def sample_field source · line 4912 · raw

@build:FieldBuild -> @info:ArgInfo -> List<&2, Field>

def sample_args source · line 4922 · raw

@items:List<&2, Item> -> List<&2, Field>

Each arg in scope: its default as parse resolves it, else a sample value.

def sample_fields source · line 4932 · raw

@c:Cmd -> @path:List<&2, String> -> List<&2, Field>

def sample source · line 4936 · raw

@+c:Cmd -> @+path:List<&2, String> -> Matches

def sub_paths source · line 4940 · raw

@items:List<&2, Item> -> @+prefix:List<&2, String> -> List<&2, List<&2, String>>

The paths below prefix that can complete, in pre-order, without built-ins.

def sample_paths source · line 4954 · raw

@c:Cmd -> List<&2, List<&2, String>>

def decode_bug source · line 4961 · raw

@-A:Type -> @d:Dec(A) -> @at:String -> List<&2, Problem>

def cmd_name source · line 4966 · raw

@c:Cmd -> String

def host_tty source · line 4988 · raw

@h:Host -> @out:Bool -> @err:Bool -> Host

def color_attrs source · line 4993 · raw

@attrs:List<&2, Item> -> Bool

Rules 1 and 2 apply only to color() exactly as declared.

def is_color source · line 5000 · raw

@item:Item -> Bool

def has_color source · line 5007 · raw

@items:List<&2, Item> -> Bool

def color_seek source · line 5019 · raw

@dash:Bool -> @bare:Bool -> @attached:Bool -> @token:String -> @last:Maybe<&2, String> -> Prescan

def color_want source · line 5027 · raw

@hyphen:Bool -> @+token:String -> Prescan

def color_step source · line 5034 · raw

@state:Prescan -> @+token:String -> Prescan

def color_scan source · line 5042 · raw

@argv:List<&2, String> -> @state:Prescan -> Prescan

def color_word source · line 5047 · raw

@always:Bool -> @never:Bool -> Maybe<&2, Bool>

def color_value source · line 5053 · raw

@found:Maybe<&2, String> -> Maybe<&2, Bool>

def color_pick source · line 5059 · raw

@state:Prescan -> Maybe<&2, Bool>

def color_flag source · line 5065 · raw

@enabled:Bool -> @argv:List<&2, String> -> Maybe<&2, Bool>

def var_set source · line 5071 · raw

@found:Maybe<&2, String> -> Bool

An empty variable counts as unset.

def var_is source · line 5076 · raw

@found:Maybe<&2, String> -> @text:String -> Bool

def force_set source · line 5081 · raw

@found:Maybe<&2, String> -> Bool

def env_off source · line 5088 · raw

@off:Bool -> Maybe<&2, Bool>

def env_force source · line 5093 · raw

@force:Bool -> @+vars:List<&2, Var> -> Maybe<&2, Bool>

def env_rules source · line 5100 · raw

@no_color:Bool -> @+vars:List<&2, Var> -> Maybe<&2, Bool>

def env_color source · line 5107 · raw

@+vars:List<&2, Var> -> Maybe<&2, Bool>

Rules 3-6; None leaves rule 7, each stream's TTY.

def term_env source · line 5110 · raw

@found:Maybe<&2, Bool> -> @out_tty:Bool -> @err_tty:Bool -> @width:Nat -> Term

def term_for source · line 5116 · raw

@flag:Maybe<&2, Bool> -> @vars:List<&2, Var> -> @out_tty:Bool -> @err_tty:Bool -> @width:Nat -> Term

def term source · line 5122 · raw

@c:Cmd -> @h:Host -> @argv:List<&2, String> -> Term

def plain source · line 5130 · raw

@text:String -> Segment

def page_width source · line 5133 · raw

@width:Nat -> Nat

def summary source · line 5137 · raw

@s:String -> String

The first paragraph: the text before the first blank line.

def shown_text source · line 5143 · raw

@long:Bool -> @text:String -> String

def filled source · line 5148 · raw

@s:String -> Bool

def join_filled source · line 5151 · raw

@parts:List<&2, String> -> String

def find_command source · line 5160 · raw

@items:List<&2, Item> -> @+query:String -> @found:Maybe<&2, Item> -> Maybe<&2, Item>

def view_enter source · line 5172 · raw

@found:Maybe<&2, Item> -> @path:String -> @about:String -> @items:List<&2, Item> -> @globals:List<&2, Item> -> @root:Bool -> View

def view_step source · line 5180 · raw

@view:View -> @step:String -> View

def view_walk source · line 5188 · raw

@steps:List<&2, String> -> @view:View -> View

def view_of source · line 5193 · raw

@c:Cmd -> @path:List<&2, String> -> View

def arg_pos source · line 5198 · raw

@usage:String -> Bool

def has_plain_option source · line 5201 · raw

@items:List<&2, Item> -> Bool

def required_elem source · line 5210 · raw

@required:Bool -> @usage:String -> @attrs:List<&2, Item> -> List<&2, Segment>

def required_options source · line 5216 · raw

@items:List<&2, Item> -> List<&2, Segment>

def group_elem source · line 5226 · raw

@listed:Bool -> @args:List<&2, Item> -> @group:String -> List<&2, Segment>

def group_elems source · line 5233 · raw

@items:List<&2, Item> -> @+args:List<&2, Item> -> @+done:List<&2, String> -> List<&2, Segment>

Each need_one group of items, over args, that done does not name yet.

def positional_elems source · line 5244 · raw

@items:List<&2, Item> -> List<&2, Segment>

def command_elems source · line 5252 · raw

@subs:Bool -> @need:Bool -> List<&2, Segment>

def options_elem source · line 5258 · raw

@present:Bool -> List<&2, Segment>

def usage_elems source · line 5265 · raw

@path:String -> @+items:List<&2, Item> -> @+globals:List<&2, Item> -> List<&2, Segment>

The path, [OPTIONS], required options, need_one groups as E06 writes them, positionals, then the subcommand slot.

def segment_texts source · line 5278 · raw

@segs:List<&2, Segment> -> List<&2, String>

def usage_view source · line 5283 · raw

@view:View -> String

def usage source · line 5288 · raw

@c:Cmd -> @path:List<&2, String> -> String

def usage_rest source · line 5292 · raw

@elems:List<&2, Segment> -> @+w:Nat -> @+col:Nat -> List<&2, Segment>

Usage wraps between elements and continues at column 7.

def usage_block source · line 5303 · raw

@elems:List<&2, Segment> -> @w:Nat -> List<&2, Segment>

def tag source · line 5318 · raw

@name:String -> @values:List<&2, String> -> String

def maybe_list source · line 5324 · raw

@found:Maybe<&2, String> -> List<&2, String>

def list_or_none source · line 5329 · raw

@found:Maybe<&2, List<&2, String>> -> List<&2, String>

def right_text source · line 5334 · raw

@long:Bool -> @help:String -> @+attrs:List<&2, Item> -> String

def bold_names source · line 5343 · raw

@names:List<&2, String> -> @first:Bool -> List<&2, Segment>

def value_cut source · line 5352 · raw

@s:String -> Nat

Where an option's value or repeat starts: " <", "[=", or a final "...".

def option_left source · line 5361 · raw

@+usage:String -> List<&2, Segment>

Option names bold; separators, value and repeat plain.

def arg_row source · line 5367 · raw

@parsed:Usage -> @usage:String -> @help:String -> @attrs:List<&2, Item> -> @long:Bool -> Row

def find_heading source · line 5376 · raw

@attrs:List<&2, Item> -> String

def option_row source · line 5382 · raw

@shown:Bool -> @+usage:String -> @help:String -> @attrs:List<&2, Item> -> @long:Bool -> List<&2, Row>

def option_rows source · line 5389 · raw

@items:List<&2, Item> -> @+long:Bool -> @+heading:String -> List<&2, Row>

The visible options under a heading, "" for Options.

def positional_row source · line 5402 · raw

@shown:Bool -> @usage:String -> @help:String -> @attrs:List<&2, Item> -> @long:Bool -> List<&2, Row>

def positional_rows source · line 5409 · raw

@items:List<&2, Item> -> @+long:Bool -> List<&2, Row>

def command_row source · line 5419 · raw

@hidden:Bool -> @name:String -> @about:String -> @children:List<&2, Item> -> List<&2, Row>

def command_rows source · line 5427 · raw

@items:List<&2, Item> -> List<&2, Row>

def help_sub_row source · line 5436 · raw

@present:Bool -> List<&2, Row>

def builtin_row source · line 5444 · raw

@taken:Bool -> @short:String -> @long:String -> @text:String -> Row

A built-in option row, without its short when an app arg took it.

def help_text source · line 5451 · raw

@differs:Bool -> @long:Bool -> String

def version_row source · line 5457 · raw

@present:Bool -> @args:List<&2, Item> -> List<&2, Row>

def heading_titles source · line 5465 · raw

@items:List<&2, Item> -> @+seen:List<&2, String> -> List<&2, String>

Headings of visible args, in order of first use.

def heading_sections source · line 5477 · raw

@titles:List<&2, String> -> @+args:List<&2, Item> -> @+long:Bool -> List<&2, Section>

def args_paragraphs source · line 5486 · raw

@items:List<&2, Item> -> Bool

Whether a visible arg's help has more than one paragraph.

def indent_cell source · line 5494 · raw

@indent:Bool -> @left:List<&2, Segment> -> List<&2, Segment>

def row_cell source · line 5500 · raw

@row:Row -> @shorted:Bool -> List<&2, Segment>

A left cell; long-only options indent 4 more on a page with a short.

def cell_width source · line 5505 · raw

@cell:List<&2, Segment> -> Nat

def row_short source · line 5510 · raw

@row:Row -> Bool

def any_short source · line 5514 · raw

@rows:List<&2, Row> -> Bool

def widest source · line 5520 · raw

@rows:List<&2, Row> -> @+shorted:Bool -> @+k:Nat -> @+best:Nat -> Nat

L, the widest left cell w with 2 + w + 2 <= K.

def pad_line source · line 5528 · raw

@line:String -> @col:Nat -> String

def pad_lines source · line 5534 · raw

@lines:List<&2, String> -> @+col:Nat -> List<&2, Segment>

def first_then source · line 5539 · raw

@lines:List<&2, String> -> @col:Nat -> List<&2, Segment>

def row_form source · line 5546 · raw

@fits:Bool -> @cell:List<&2, Segment> -> @lw:Nat -> @right:String -> @w:Nat -> @+c:Nat -> List<&2, Segment>

A cell that fits takes its text after padding to C; one that does not stands alone, its text on the next lines at max(C, 10).

def row_lines source · line 5558 · raw

@row:Row -> @shorted:Bool -> @w:Nat -> @k:Nat -> @c:Nat -> List<&2, Segment>

def rows_lines source · line 5566 · raw

@rows:List<&2, Row> -> @+shorted:Bool -> @+w:Nat -> @+k:Nat -> @+c:Nat -> List<&2, Segment>

def section_rows source · line 5574 · raw

@sections:List<&2, Section> -> List<&2, Row>

def section_blocks source · line 5580 · raw

@sections:List<&2, Section> -> @+shorted:Bool -> @+w:Nat -> @+k:Nat -> @+c:Nat -> List<&2, List<&2, Segment>>

def sections_blocks source · line 5591 · raw

@+sections:List<&2, Section> -> @+w:Nat -> List<&2, List<&2, Segment>>

One column for the page: C = L + 4, with K = 2W/5.

def text_block source · line 5599 · raw

@text:String -> @w:Nat -> List<&2, List<&2, Segment>>

def example_lines source · line 5604 · raw

@items:List<&2, Item> -> List<&2, Segment>

def examples_block source · line 5612 · raw

@lines:List<&2, Segment> -> List<&2, List<&2, Segment>>

def after_texts source · line 5617 · raw

@items:List<&2, Item> -> List<&2, String>

def more_blocks source · line 5623 · raw

@blocks:List<&2, List<&2, Segment>> -> List<&2, Segment>

def join_blocks source · line 5630 · raw

@blocks:List<&2, List<&2, Segment>> -> List<&2, Segment>

Blocks apart by one blank line; the page ends with a newline.

def help_page source · line 5635 · raw

@view:View -> @+long:Bool -> @+w:Nat -> List<&2, Segment>

def help_out source · line 5658 · raw

@t:Term -> @view:View -> @long:Bool -> String

def help source · line 5664 · raw

@+c:Cmd -> @path:List<&2, String> -> @long:Bool -> @h:Host -> String

The help page for the longest valid prefix of path, in stdout's colors.

def row_zero source · line 5672 · raw

@b:String -> @+k:Nat -> List<&2, Nat>

def head_nat source · line 5677 · raw

@xs:List<&2, Nat> -> Nat

def tail_nats source · line 5682 · raw

@xs:List<&2, Nat> -> List<&2, Nat>

def same_char source · line 5687 · raw

@found:Maybe<&2, Char> -> @c:Char -> Bool

def osa_row source · line 5694 · raw

@bs:String -> @bp:Maybe<&2, Char> -> @+a:Char -> @+ap:Maybe<&2, Char> -> @+up:List<&2, Nat> -> @+up2:List<&2, Nat> -> @left:Nat -> List<&2, Nat>

Row i of optimal string alignment for a[i]: up starts at d[i-1][j-1], up2 at d[i-2][j-2], and left is d[i][j-1].

def osa_rows source · line 5708 · raw

@s:String -> @ap:Maybe<&2, Char> -> @+i:Nat -> @+b:String -> @+prev:List<&2, Nat> -> @prev2:List<&2, Nat> -> List<&2, Nat>

def last_nat source · line 5716 · raw

@xs:List<&2, Nat> -> @last:Nat -> Nat

def osa source · line 5721 · raw

@a:String -> @+b:String -> Nat

def undashed source · line 5725 · raw

@s:String -> String

def scored source · line 5730 · raw

@names:List<&2, String> -> @+typed:String -> @+limit:Nat -> List<&2, Scored>

def at_distance source · line 5740 · raw

@found:List<&2, Scored> -> @+d:Nat -> List<&2, String>

def by_distance source · line 5747 · raw

@levels:Nat -> @+d:Nat -> @+found:List<&2, Scored> -> List<&2, String>

def suggest source · line 5759 · raw

@+typed:String -> @names:List<&2, String> -> List<&2, String>

At most 3 names within max(1, n / 3) edits, by distance, then order. key is bound because a temporary argument makes String.length take its string, adding a keep to each caller that reuses one (Nat.read.fits, arg_display).

def quoted source · line 5767 · raw

@text:String -> @styles:List<&2, Style> -> List<&2, Segment>

def missing_lines source · line 5770 · raw

@missing:List<&2, String> -> String

def visible_subs source · line 5775 · raw

@items:List<&2, Item> -> List<&2, String>

def fault_message source · line 5783 · raw

@fault:ScanFault -> @path:String -> @items:List<&2, Item> -> List<&2, Segment>

def green_names source · line 5825 · raw

@names:List<&2, String> -> @first:Bool -> List<&2, Segment>

def tip source · line 5833 · raw

@text:String -> List<&2, List<&2, Segment>>

def similar source · line 5837 · raw

@kind:String -> @found:List<&2, String> -> List<&2, List<&2, Segment>>

T4: one suggestion or several.

def long_name source · line 5848 · raw

@s:String -> Bool

def option_names source · line 5851 · raw

@parsed:Usage -> @attrs:List<&2, Item> -> List<&2, String>

def visible_names source · line 5863 · raw

@hidden:Bool -> @usage:String -> @attrs:List<&2, Item> -> List<&2, String>

def long_candidates source · line 5870 · raw

@items:List<&2, Item> -> List<&2, String>

T4 for E01: visible longs, their no- forms and long aliases.

def sub_candidates source · line 5879 · raw

@items:List<&2, Item> -> List<&2, String>

T4 for E02: visible subcommand names and aliases, then help.

def display_choices source · line 5890 · raw

@items:List<&2, Item> -> @+arg:String -> @found:List<&2, String> -> List<&2, String>

T4 for E04: the one_of values of the arg E04 names.

def owned source · line 5901 · raw

@found:Maybe<&2, OptFound> -> @text:String -> Maybe<&2, String>

def owned_by source · line 5906 · raw

@hit:Maybe<&2, OptFound> -> @token:String -> @prefix:String -> @step:String -> @found:Maybe<&2, String> -> Maybe<&2, String>

def owner source · line 5915 · raw

@path:List<&2, String> -> @+items:List<&2, Item> -> @+prefix:String -> @+token:String -> @+long:String -> @found:Maybe<&2, String> -> Maybe<&2, String>

T1: the deepest ancestor whose args take the long, and its child on path.

def descendant source · line 5926 · raw

@items:List<&2, Item> -> @+prefix:String -> @+long:String -> @found:Maybe<&2, String> -> Maybe<&2, String>

T2: the first subcommand in pre-order whose args take the long.

def maybe_tip source · line 5937 · raw

@found:Maybe<&2, String> -> List<&2, List<&2, Segment>>

def belongs source · line 5942 · raw

@found:Maybe<&2, String> -> @token:String -> List<&2, List<&2, Segment>>

def sub_exists source · line 5949 · raw

@found:Maybe<&2, SubFound> -> @name:String -> List<&2, List<&2, Segment>>

def before_eq source · line 5957 · raw

@s:String -> String

def long_tips source · line 5964 · raw

@is_long:Bool -> @+token:String -> @root:String -> @path:List<&2, String> -> @+items:List<&2, Item> -> @root_items:List<&2, Item> -> @here:String -> List<&2, List<&2, Segment>>

T1, T2 and T3, for E01 on a long; --name=value looks up --name.

def operand_count source · line 5979 · raw

@events:List<&2, ScanEvent> -> @count:Nat -> Nat

def trace_operands source · line 5986 · raw

@trace:ScanTrace -> Nat

def dash_slot source · line 5991 · raw

@open:Bool -> @+token:String -> List<&2, List<&2, Segment>>

def dash_tip source · line 6000 · raw

@hyphen:Bool -> @token:String -> @items:List<&2, Item> -> @c:Cmd -> @argv:List<&2, String> -> List<&2, List<&2, Segment>>

T5: a hyphen token that the next positional slot could take after --; only then is argv scanned again to count the operands in scope.

def cmd_items source · line 6008 · raw

@c:Cmd -> List<&2, Item>

def fault_tips source · line 6013 · raw

@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>>

Every tip that applies, in table order.

def tip_spans source · line 6037 · raw

@tips:List<&2, List<&2, Segment>> -> List<&2, Segment>

def tip_block source · line 6045 · raw

@tips:List<&2, List<&2, Segment>> -> List<&2, Segment>

def error_page source · line 6050 · raw

@message:List<&2, Segment> -> @tips:List<&2, List<&2, Segment>> -> @usage:List<&2, Segment> -> List<&2, Segment>

def fault_view source · line 6060 · raw

@view:View -> @+fault:ScanFault -> @c:Cmd -> @path:List<&2, String> -> @argv:List<&2, String> -> @w:Nat -> List<&2, Segment>

def fault_err source · line 6069 · raw

@t:Term -> @fault:ScanFault -> @+c:Cmd -> @+path:List<&2, String> -> @argv:List<&2, String> -> String

An error at the scope where scanning stopped, in stderr's colors.

def unknown_text source · line 6080 · raw

@c:Cmd -> @path:List<&2, String> -> @name:String -> @t:Term -> String

The E02 page eval prints for an unknown subcommand name at path, with its similar names and the scope's usage, in t's stderr colors and width. An app with external() prints it, and exits 2 as eval does, when no plugin answers to name.

def summary_err source · line 6084 · raw

@t:Term -> @view:View -> String

def problem_line source · line 6091 · raw

@p:Problem -> String

def problem_lines source · line 6128 · raw

@found:List<&2, Problem> -> String

def sh_body source · line 6140 · raw

@s:String -> String

def Sh.quote source · line 6147 · raw

@s:String -> String

POSIX single quotes, with ' written as '\'' (P3).

def fish_body source · line 6150 · raw

@s:String -> String

def Fish.quote source · line 6158 · raw

@s:String -> String

fish single quotes, with \ and ' backslash-escaped (P4).

def Zsh.esc source · line 6163 · raw

@s:String -> String

Text in an _arguments spec or a _describe entry, with \, [, ] and : backslash-escaped (P5).

def roff_body source · line 6174 · raw

@s:String -> @start:Bool -> String

Text for man(7), start telling whether a line starts here: \, -, ", ' and ` as escapes, and \& before a . or a space that starts a line.

def Roff.esc source · line 6188 · raw

@s:String -> String

Text that starts lines (P6, P15).

def roff_text source · line 6192 · raw

@s:String -> String

Text after the start of a line.

def text_lines source · line 6195 · raw

@lines:List<&2, String> -> String

def one_line source · line 6201 · raw

@s:String -> String

The summary with its hard line breaks as spaces.

def ident_char source · line 6204 · raw

@+c:Char -> Char

def ident source · line 6208 · raw

@s:String -> String

A name with every char outside [A-Za-z0-9_] as _, for shell identifiers.

def same_words source · line 6213 · raw

@a:List<&2, String> -> @b:List<&2, String> -> Bool

def last_with source · line 6219 · raw

@lines:List<&2, String> -> @+suffix:String -> List<&2, String>

def places source · line 6232 · raw

@items:List<&2, Item> -> @+words:List<&2, String> -> @+globals:List<&2, Item> -> List<&2, Place>

The visible commands below items, whose subcommands inherit globals.

def all_places source · line 6245 · raw

@+items:List<&2, Item> -> List<&2, Place>

def list_number source · line 6272 · raw

@lists:List<&2, List<&2, String>> -> @+values:List<&2, String> -> @hit:Bool -> @+k:Nat -> Nat

The number of values in lists, counting from k + 1 after a miss, or 0.

def add_list source · line 6280 · raw

@found:Maybe<&2, List<&2, String>> -> @+lists:List<&2, List<&2, String>> -> List<&2, List<&2, String>>

def visible_one_of source · line 6289 · raw

@hidden:Bool -> @attrs:List<&2, Item> -> Maybe<&2, List<&2, String>>

def item_lists source · line 6295 · raw

@items:List<&2, Item> -> @lists:List<&2, List<&2, String>> -> List<&2, List<&2, String>>

def place_lists source · line 6304 · raw

@places:List<&2, Place> -> @lists:List<&2, List<&2, String>> -> List<&2, List<&2, String>>

The one_of lists of visible args, each once, in pre-order.

def type_comp source · line 6311 · raw

@found:Maybe<&2, ValueType> -> Comp

def comp_of source · line 6317 · raw

@found:Maybe<&2, List<&2, String>> -> @t:Maybe<&2, ValueType> -> @lists:List<&2, List<&2, String>> -> Comp

def head_part source · line 6323 · raw

@parts:List<&2, String> -> String

def next_part source · line 6328 · raw

@parts:List<&2, String> -> String

def between source · line 6333 · raw

@s:String -> @+open:Char -> @close:Char -> String

def placeholder source · line 6337 · raw

@+usage:String -> String

The name in a usage's <>, or in an optional positional's [].

def short_alias source · line 6341 · raw

@s:String -> Bool

def short_names source · line 6344 · raw

@parsed:Usage -> @attrs:List<&2, Item> -> List<&2, String>

def parsed_kind source · line 6352 · raw

@parsed:Usage -> UsageKind

def arg_opt source · line 6357 · raw

@+parsed:Usage -> @usage:String -> @help:String -> @+attrs:List<&2, Item> -> @lists:List<&2, List<&2, String>> -> Opt

def arg_opts source · line 6365 · raw

@items:List<&2, Item> -> @+lists:List<&2, List<&2, String>> -> List<&2, Opt>

The visible options in items.

def flag_opt source · line 6377 · raw

@names:List<&2, String> -> @help:String -> Opt

def version_opts source · line 6380 · raw

@present:Bool -> @args:List<&2, Item> -> List<&2, Opt>

def builtin_opts source · line 6390 · raw

@+items:List<&2, Item> -> @globals:List<&2, Item> -> @root:Bool -> List<&2, Opt>

-h and --help, without -h when an arg took it, then at a root with a version -V and --version likewise.

def pos_slot source · line 6398 · raw

@parsed:Usage -> @k:Nat -> @usage:String -> @+attrs:List<&2, Item> -> @lists:List<&2, List<&2, String>> -> List<&2, Slot>

def arg_slots source · line 6407 · raw

@items:List<&2, Item> -> @+k:Nat -> @+lists:List<&2, List<&2, String>> -> List<&2, Slot>

The positional slots in items, hidden ones too, numbered from k.

def completing source · line 6419 · raw

@slots:List<&2, Slot> -> List<&2, Slot>

The slots up to the variadic one, which takes every later value.

def variadic source · line 6426 · raw

@slots:List<&2, Slot> -> Maybe<&2, Slot>

def sub_entries source · line 6434 · raw

@items:List<&2, Item> -> List<&2, Entry>

The visible subcommands in items.

def opt_names source · line 6443 · raw

@opts:List<&2, Opt> -> List<&2, String>

def entry_names source · line 6449 · raw

@entries:List<&2, Entry> -> List<&2, String>

def stop_of source · line 6461 · raw

@place:Place -> @k:Nat -> @+lists:List<&2, List<&2, String>> -> Stop

def stops source · line 6470 · raw

@places:List<&2, Place> -> @+k:Nat -> @+lists:List<&2, List<&2, String>> -> List<&2, Stop>

def stop_number source · line 6478 · raw

@stops:List<&2, Stop> -> @+words:List<&2, String> -> @found:Maybe<&2, Nat> -> Nat

The number of the stop at words, from found on.

def sh_list source · line 6490 · raw

@words:List<&2, String> -> @+sep:String -> String

Words quoted for sh, apart by sep.

def dests source · line 6496 · raw

@names:List<&2, String> -> @+dest:String -> List<&2, String>

def entry_dests source · line 6502 · raw

@entries:List<&2, Entry> -> @+words:List<&2, String> -> List<&2, String>

Each subcommand name's path, once per name.

def bash_subs source · line 6511 · raw

@+entries:List<&2, Entry> -> @words:List<&2, String> -> List<&2, String>

def bash_shape source · line 6519 · raw

@found:Maybe<&2, Slot> -> List<&2, String>

def bash_scope_arm source · line 6526 · raw

@stop:Stop -> List<&2, String>

def bash_letter source · line 6537 · raw

@comp:Comp -> String

def bash_values source · line 6544 · raw

@comp:Comp -> String

def bash_kind source · line 6549 · raw

@+comp:Comp -> @bare:Bool -> String

def bash_opt_case source · line 6553 · raw

@opt:Opt -> List<&2, String>

def bash_opt_cases source · line 6563 · raw

@opts:List<&2, Opt> -> List<&2, String>

def bash_slot_cases source · line 6568 · raw

@slots:List<&2, Slot> -> List<&2, String>

def bash_cases source · line 6580 · raw

@words:List<&2, String> -> @cases:List<&2, String> -> List<&2, String>

def bash_arg_arm source · line 6592 · raw

@stop:Stop -> List<&2, String>

def bash_engine source · line 6605 · raw

@+id:String -> @name:String -> List<&2, String>

The rest of every bash script, for function prefix id and the quoted command name: the parser of COMP_WORDS, then the binding.

def bash_script source · line 6713 · raw

@+name:String -> @+items:List<&2, Item> -> String

def zsh_action source · line 6744 · raw

@comp:Comp -> String

def zsh_pre source · line 6753 · raw

@kind:UsageKind -> @+names:List<&2, String> -> String

The prefix of an option's specs: * when it repeats, else its names as a group that excludes each other.

def zsh_spec source · line 6761 · raw

@+name:String -> @kind:UsageKind -> @pre:String -> @d:String -> @ph:String -> @act:String -> String

def zsh_names source · line 6771 · raw

@names:List<&2, String> -> @+kind:UsageKind -> @+pre:String -> @+d:String -> @+ph:String -> @+act:String -> List<&2, String>

def zsh_opts source · line 6779 · raw

@opts:List<&2, Opt> -> List<&2, String>

def zsh_slots source · line 6788 · raw

@slots:List<&2, Slot> -> List<&2, String>

def zsh_spec_lines source · line 6802 · raw

@specs:List<&2, String> -> @+ind:String -> List<&2, String>

Specs quoted, one per line, all but the last continued.

def zsh_args source · line 6811 · raw

@+ind:String -> @specs:List<&2, String> -> List<&2, String>

def zsh_entry source · line 6814 · raw

@names:List<&2, String> -> @+ind:String -> @+about:String -> List<&2, String>

def zsh_entries source · line 6822 · raw

@entries:List<&2, Entry> -> @+ind:String -> List<&2, String>

def zsh_commands source · line 6829 · raw

@entries:List<&2, Entry> -> @with_help:Bool -> @label:String -> @+ind:String -> List<&2, String>

def zsh_label source · line 6842 · raw

@+name:String -> @words:List<&2, String> -> String

def zsh_deeper source · line 6845 · raw

@arms:List<&2, String> -> @+depth:Nat -> @+ind:String -> List<&2, String>

def zsh_help_tree source · line 6858 · raw

@entries:List<&2, Entry> -> @label:String -> @arms:List<&2, String> -> @+depth:Nat -> @+ind:String -> List<&2, String>

After help at depth, the subcommand names, then deeper by arms.

def bar_names source · line 6867 · raw

@names:List<&2, String> -> String

def zsh_help_arms source · line 6875 · raw

@items:List<&2, Item> -> @+name:String -> @+words:List<&2, String> -> @+depth:Nat -> @+ind:String -> List<&2, String>

The help tree's arms at ind for the subcommands in items that have subcommands of their own.

def zsh_past_end source · line 6895 · raw

@ind:String -> String

Ends a state that _arguments entered past a "--" it dropped, after which no subcommand follows.

def zsh_ends source · line 6900 · raw

@words:List<&2, String> -> @+ind:String -> List<&2, String>

At the top command (no words), the count of "--" before the cursor that zsh_past_end compares with.

def zsh_branch source · line 6912 · raw

@+entries:List<&2, Entry> -> @specs:List<&2, String> -> @+items:List<&2, Item> -> @+name:String -> @+words:List<&2, String> -> @arms:List<&2, String> -> @+ind:String -> List<&2, String>

The body of a command with subcommands: its specs end in a state that offers them, completes help's tree, or enters the arm of the one given.

def zsh_body source · line 6945 · raw

@entries:List<&2, Entry> -> @specs:List<&2, String> -> @+items:List<&2, Item> -> @+lists:List<&2, List<&2, String>> -> @name:String -> @words:List<&2, String> -> @arms:List<&2, String> -> @ind:String -> List<&2, String>

def zsh_cmd source · line 6958 · raw

@+items:List<&2, Item> -> @+globals:List<&2, Item> -> @+lists:List<&2, List<&2, String>> -> @name:String -> @+words:List<&2, String> -> @arms:List<&2, String> -> @ind:String -> List<&2, String>

The body at ind of the command with items and globals at words, given the arms of its subcommands.

def zsh_arms source · line 6972 · raw

@items:List<&2, Item> -> @+globals:List<&2, Item> -> @+lists:List<&2, List<&2, String>> -> @+name:String -> @+words:List<&2, String> -> @+ind:String -> List<&2, String>

The arms at ind for the visible subcommands in items, which inherit globals; their bodies are 2 deeper.

def zsh_lists source · line 6990 · raw

@lists:List<&2, List<&2, String>> -> @+k:Nat -> List<&2, String>

def zsh_arrays source · line 6998 · raw

@lists:List<&2, List<&2, String>> -> List<&2, String>

def zsh_script source · line 7005 · raw

@+name:String -> @+items:List<&2, Item> -> String

def fish_list source · line 7028 · raw

@words:List<&2, String> -> String

Words quoted for fish, apart by spaces.

def fish_pats source · line 7034 · raw

@names:List<&2, String> -> @+pre:String -> List<&2, String>

def fish_dest_arms source · line 7041 · raw

@entries:List<&2, Entry> -> @+pre:String -> @+words:List<&2, String> -> @+found:List<&2, Stop> -> List<&2, String>

The arms of _dest for subcommands entries of the path at words, numbered pre.

def fish_dests source · line 7051 · raw

@stops:List<&2, Stop> -> @+found:List<&2, Stop> -> List<&2, String>

def valued_names source · line 7060 · raw

@opts:List<&2, Opt> -> List<&2, String>

def fish_valued_arm source · line 7067 · raw

@k:Nat -> @names:List<&2, String> -> List<&2, String>

def fish_valued source · line 7075 · raw

@stop:Stop -> List<&2, String>

def slot_shape source · line 7080 · raw

@found:Maybe<&2, Slot> -> String

def fish_shape_arm source · line 7086 · raw

@shown:Bool -> @k:Nat -> @has:Bool -> @found:Maybe<&2, Slot> -> List<&2, String>

def fish_shape source · line 7095 · raw

@stop:Stop -> List<&2, String>

def fish_values source · line 7103 · raw

@lists:List<&2, List<&2, String>> -> @+k:Nat -> List<&2, String>

def fish_values_fn source · line 7112 · raw

@+id:String -> @lists:List<&2, List<&2, String>> -> List<&2, String>

def fish_flag source · line 7124 · raw

@long:Bool -> @name:String -> String

def fish_flags source · line 7129 · raw

@names:List<&2, String> -> List<&2, String>

def fish_words source · line 7135 · raw

@+id:String -> @comp:Comp -> String

What completes a value comp offers: words, files, directories or none.

def fish_needs source · line 7143 · raw

@comp:Comp -> String

def fish_kind source · line 7150 · raw

@kind:UsageKind -> @+id:String -> @+comp:Comp -> String

An option of kind needs its value (-r), and only a file name may be any word (-x elsewhere); a [=<V>] value is optional.

def fish_opt_lines source · line 7157 · raw

@opts:List<&2, Opt> -> @+at:String -> @+id:String -> List<&2, String>

def fish_builtin_lines source · line 7167 · raw

@opts:List<&2, Opt> -> @+at:String -> @tags:String -> List<&2, String>

The built-ins, help first, which also holds after help (h).

def fish_name_lines source · line 7175 · raw

@names:List<&2, String> -> @+at:String -> @+about:String -> List<&2, String>

def fish_sub_lines source · line 7183 · raw

@entries:List<&2, Entry> -> @+at:String -> List<&2, String>

def fish_slot_lines source · line 7190 · raw

@slots:List<&2, Slot> -> @+at:String -> @+id:String -> List<&2, String>

def fish_ends source · line 7202 · raw

@subs:List<&2, Entry> -> @+at:String -> @id:String -> @slots:List<&2, Slot> -> List<&2, String>

def fish_lines source · line 7210 · raw

@stops:List<&2, Stop> -> @+pre:String -> @+id:String -> List<&2, String>

def fish_engine source · line 7225 · raw

@+id:String -> List<&2, String>

The function every fish script shares, for function prefix id: it walks the words before the cursor as the bash engine does.

def fish_script source · line 7294 · raw

@+name:String -> @+items:List<&2, Item> -> String

def roff_bold source · line 7333 · raw

@s:String -> String

def roff_bolds source · line 7336 · raw

@names:List<&2, String> -> List<&2, String>

def roff_texts source · line 7341 · raw

@texts:List<&2, String> -> List<&2, String>

def spaces_only source · line 7346 · raw

@s:String -> Bool

def line_mark source · line 7352 · raw

@blank:Bool -> @line:String -> List<&2, Maybe<&2, String>>

def para_marks source · line 7359 · raw

@lines:List<&2, String> -> List<&2, Maybe<&2, String>>

Each line, None for an empty one, which ends a paragraph; a line of only spaces is left out.

def roff_marks source · line 7369 · raw

@marks:List<&2, Maybe<&2, String>> -> @+sep:String -> @gap:Maybe<&2, String> -> List<&2, String>

Marked lines escaped, after gap: nothing before the first, .br within a paragraph, sep between paragraphs.

def roff_paras source · line 7380 · raw

@text:String -> @sep:String -> List<&2, String>

def ph_end source · line 7383 · raw

@s:String -> Nat

def roff_ph source · line 7390 · raw

@+s:String -> String

A placeholder's name in italics, from after its <.

def roff_value source · line 7395 · raw

@rest:String -> String

def roff_option source · line 7404 · raw

@+usage:String -> String

Option names bold, the placeholder in italics.

def roff_positional source · line 7410 · raw

@+usage:String -> String

A positional in italics, apart from its repeat.

def roff_entry source · line 7415 · raw

@left:String -> @help:String -> @attrs:List<&2, Item> -> List<&2, String>

def roff_positional_entry source · line 7419 · raw

@shown:Bool -> @usage:String -> @help:String -> @attrs:List<&2, Item> -> List<&2, String>

def roff_positionals source · line 7425 · raw

@items:List<&2, Item> -> List<&2, String>

def roff_option_entry source · line 7435 · raw

@shown:Bool -> @usage:String -> @help:String -> @attrs:List<&2, Item> -> List<&2, String>

def roff_options source · line 7442 · raw

@items:List<&2, Item> -> @+heading:String -> List<&2, String>

The visible options under a heading, "" for OPTIONS.

def roff_builtins source · line 7453 · raw

@opts:List<&2, Opt> -> List<&2, String>

def roff_headings source · line 7460 · raw

@titles:List<&2, String> -> @+args:List<&2, Item> -> List<&2, String>

def roff_command source · line 7469 · raw

@hidden:Bool -> @+page:String -> @name:String -> @about:String -> @children:List<&2, Item> -> List<&2, String>

def roff_commands source · line 7478 · raw

@items:List<&2, Item> -> @+page:String -> List<&2, String>

def roff_arg source · line 7487 · raw

@pos:Bool -> @+usage:String -> @attrs:List<&2, Item> -> String

def roff_env_names source · line 7492 · raw

@names:List<&2, String> -> List<&2, String>

def roff_env_order source · line 7498 · raw

@rest:List<&2, String> -> String

How a variable after the first is read, if there is one.

def roff_env source · line 7503 · raw

@hidden:Bool -> @names:List<&2, String> -> @+usage:String -> @attrs:List<&2, Item> -> List<&2, String>

def roff_envs source · line 7512 · raw

@items:List<&2, Item> -> List<&2, String>

def roff_examples source · line 7521 · raw

@items:List<&2, Item> -> @before:List<&2, String> -> List<&2, String>

def sub_pages source · line 7534 · raw

@items:List<&2, Item> -> @+page:String -> List<&2, String>

def init_words source · line 7543 · raw

@words:List<&2, String> -> List<&2, String>

def parent_pages source · line 7550 · raw

@words:List<&2, String> -> List<&2, String>

The parent's page, none at the root.

def roff_refs source · line 7556 · raw

@pages:List<&2, String> -> List<&2, String>

def roff_see source · line 7561 · raw

@pages:List<&2, String> -> List<&2, String>

def roff_synopsis source · line 7566 · raw

@texts:List<&2, String> -> String

def roff_section source · line 7571 · raw

@title:String -> @lines:List<&2, String> -> List<&2, String>

def roff_view source · line 7576 · raw

@view:View -> @title:String -> String

def find_version source · line 7607 · raw

@items:List<&2, Item> -> String

def roff source · line 7614 · raw

@c:Cmd -> @path:List<&2, String> -> String

The man page of the command at the longest valid prefix of path (§11).

def script source · line 7621 · raw

@c:Cmd -> @s:Shell -> String

The completion script for shell s (§11).

def sub_at source · line 7634 · raw

@path:List<&2, String> -> @items:List<&2, Item> -> @found:Maybe<&2, SubFound> -> Maybe<&2, SubFound>

The subcommand at path, from found on.

def builtin_name source · line 7642 · raw

@found:Maybe<&2, SubFound> -> Maybe<&2, String>

def field_values source · line 7648 · raw

@f:Field -> List<&2, String>

def shell_named source · line 7653 · raw

@+name:String -> Shell

The shell completions was given, which one_of limits to these three.

def builtin_page source · line 7657 · raw

@man:Bool -> @c:Cmd -> @fields:List<&2, Field> -> String

def outcome_accepted source · line 7666 · raw

@builtin:Maybe<&2, String> -> @c:Cmd -> @path:List<&2, String> -> @fields:List<&2, Field> -> @external:Maybe<&2, ExternalArgs> -> Outcome

V6: the completions built-in prints its script and man its page, plain; any other path is left to decode.

def outcome_parse source · line 7673 · raw

@result:ParseResult -> @+c:Cmd -> @h:Host -> @+argv:List<&2, String> -> Outcome

def outcome_lint source · line 7689 · raw

@found:List<&2, Problem> -> @+c:Cmd -> @+h:Host -> @+argv:List<&2, String> -> Outcome

def outcome source · line 7699 · raw

@+c:Cmd -> @h:Host -> @argv:List<&2, String> -> Outcome

eval through V6: a lint failure, help, version, the V3 summary, an error or a built-in's output is Shown; Matched is a parse left to decode.

def linted_found source · line 7706 · raw

@found:List<&2, Problem> -> @c:Cmd -> Result<&2, &2, List<&2, Problem>, Linted>

def linted source · line 7713 · raw

@+c:Cmd -> Result<&2, &2, List<&2, Problem>, Linted>

Lint c once: a Linted, or lint's problems in the order problems lists.

def outcome_linted source · line 7717 · raw

@l:Linted -> @+h:Host -> @+argv:List<&2, String> -> Outcome

outcome on a Linted's spec, without the lint.

def usage_err source · line 7729 · raw

@t:Term -> @msg:String -> @view:View -> String

E12: a decoder's Usage message as an error at the matched scope, printed as given, in stderr's colors.

def faulted source · line 7736 · raw

@-A:Type -> @f:Fault -> @+cmd:Cmd -> @path:List<&2, String> -> @h:Host -> @argv:List<&2, String> -> Step<A>

def decoded source · line 7744 · raw

@-A:Type -> @d:Dec(A) -> @cmd:Cmd -> @path:List<&2, String> -> @h:Host -> @argv:List<&2, String> -> Step<A>

V7: Done is Go with term's decisions; a fault exits 70 or 2.

def eval_step source · line 7750 · raw

@-A:Type -> @decode:(@+m:Matches -> Dec(A)) -> @o:Outcome -> @h:Host -> @argv:List<&2, String> -> Step<A>

def eval_with source · line 7759 · raw

@-A:Type -> @decode:(@+m:Matches -> Dec(A)) -> @c:Cmd -> @+h:Host -> @+argv:List<&2, String> -> Step<A>

eval with the decoder as a value, so a law can quantify over decoders.

def eval_linted_with source · line 7770 · raw

@-A:Type -> @decode:(@+m:Matches -> Dec(A)) -> @l:Linted -> @+h:Host -> @+argv:List<&2, String> -> Step<A>

eval_linted with the decoder as a value.

def env_names source · line 7782 · raw

@items:List<&2, Item> -> List<&2, String>

Each arg's env name in pre-order: an arg's own, then its subcommands'.

def distinct source · line 7792 · raw

@names:List<&2, String> -> @kept:List<&2, String> -> List<&2, String>

kept, then each name not yet in it.

def vars source · line 7798 · raw

@c:Cmd -> List<&2, String>

def columns_ok source · line 7807 · raw

@+value:String -> Bool

COLUMNS sets the width when as_nat reads it and it is at least 1. digits is bound because a temporary argument makes String.is_empty take its string, adding a take to each caller that reuses one (valid_nat).

def columns_valid source · line 7811 · raw

@ok:Bool -> @value:String -> Maybe<&2, Nat>

def columns_width source · line 7816 · raw

@found:Maybe<&2, String> -> Maybe<&2, Nat>

def tty_columns source · line 7822 · raw

@out_tty:Bool -> @err_tty:Bool -> @out_cols:U32 -> @err_cols:U32 -> Nat

stdout's columns if it is a TTY, else stderr's if it is one, else 0.

def nonzero source · line 7830 · raw

@first:Nat -> @then:Nat -> Nat

first, unless it is 0.

def width_or source · line 7835 · raw

@found:Maybe<&2, Nat> -> @then:Nat -> Nat

def probe source · line 7842 · raw

@+vars:List<&2, Var> -> @+out_tty:Bool -> @+err_tty:Bool -> @out_cols:U32 -> @err_cols:U32 -> Host

§7.3: the host from Run.host's readings; the width is COLUMNS, else the TTY columns, else 80.

def act_code source · line 7848 · raw

@fits:Bool -> @n:U32 -> Pair(U32, String)

def act_exit source · line 7856 · raw

@+n:U32 -> Pair(U32, String)

§7.2: act's code, or 70 with a stderr line when it exceeds 255.

def owed_end source · line 7866 · raw

@newline:Bool -> String

def owed_after source · line 7871 · raw

@t:String -> @c:Char -> String

def owed source · line 7877 · raw

@s:String -> String

"\n" unless s is empty or ends with one: what IO.print_err adds to s.

def ran_exit source · line 7882 · raw

@e:Pair(U32, String) -> @out:String -> @+err:String -> Ran

def ran_act source · line 7888 · raw

@r:Ran -> Ran

r with act_exit's mapping: a code above 255 becomes 70, with the bug line after r's stderr.

def utf8_lead source · line 7916 · raw

@+b:U32 -> Utf8Lead

def utf8_next source · line 7924 · raw

@ok:Bool -> @found:Maybe<&2, U32> -> Maybe<&2, U32>

def utf8_tail source · line 7931 · raw

@rest:List<&2, U32> -> @more:Nat -> @acc:U32 -> Maybe<&2, U32>

The code point acc continues to through the first more bytes of rest, each a continuation byte (80..BF); None if rest ends first or one is not.

def utf8_scalar source · line 7941 · raw

@found:Maybe<&2, U32> -> @least:U32 -> Maybe<&2, U32>

A decoded code point, if it is a Unicode scalar at least least.

def byte_escape source · line 7950 · raw

@+b:U32 -> Char

U+DC00 plus byte b, PEP 383's escape for a byte that starts no well-formed UTF-8 sequence; U+FFFD for a value past 255, no byte.

def arg_found source · line 7958 · raw

@found:Maybe<&2, U32> -> @more:Nat -> @b:U32 -> ArgChar

def arg_seq source · line 7963 · raw

@lead:Utf8Lead -> @b:U32 -> @rest:List<&2, U32> -> ArgChar

def arg_char_by source · line 7969 · raw

@ascii:Bool -> @+b:U32 -> @rest:List<&2, U32> -> ArgChar

def arg_char source · line 7975 · raw

@+b:U32 -> @rest:List<&2, U32> -> ArgChar

The char that byte b and the bytes after it, rest, start.

def arg_text_go source · line 7979 · raw

@bytes:List<&2, U32> -> @step:ArgChar -> String

step's char, then bytes as text once step's other bytes are skipped.

def arg_text source · line 7989 · raw

@bytes:List<&2, U32> -> String

A raw argument as text: each well-formed UTF-8 sequence as its char, and each byte that starts none as U+DC00 plus the byte (PEP 383), decoding on from the next byte. Run.main reads argv through it.

def cont_byte source · line 7994 · raw

@x:U32 -> U32

def utf8_bytes source · line 7998 · raw

@two:Bool -> @three:Bool -> @+x:U32 -> List<&2, U32>

Scalar x's UTF-8, for x from 80: 2 bytes below 800, 3 below 10000, else 4.

def code_bytes source · line 8007 · raw

@ascii:Bool -> @escape:Bool -> @scalar:Bool -> @+x:U32 -> List<&2, U32>

def char_bytes source · line 8019 · raw

@c:Char -> List<&2, U32>

The bytes c stands for: an escape's byte for U+DC80..U+DCFF, a Unicode scalar's UTF-8, and U+FFFD's for any other surrogate or a value past U+10FFFF, as Bend's writer prints them.

def arg_bytes source · line 8028 · raw

@s:String -> List<&2, U32>

The raw argument arg_text decoded to s: open a file by it with File.open_bytes.

Templates

template usage_kind source · line 1696 · raw

@-f:(@_:UsageKind -> Bool) -> @parsed:Usage -> Bool

template read_check source · line 4560 · raw

@-T:Data -> @-get:(@_:Field -> T) -> @verdict:Maybe<&2, String> -> @fields:List<&2, Field> -> @id:String -> Dec(T)

Validation first; reading a validated value never fails (§6.5).

template read_with source · line 4566 · raw

@-T:Data -> @-get:(@_:Field -> T) -> @want:Want -> @m:Matches -> @+id:String -> Dec(T)

template get_one source · line 4572 · raw

@-T:Data -> @-conv:(@_:String -> T) -> @f:Field -> T

template get_opt source · line 4577 · raw

@-T:Data -> @-conv:(@_:String -> T) -> @f:Field -> Maybe<&2, T>

template convert_all source · line 4582 · raw

@-T:Data -> @-conv:(@_:String -> T) -> @values:List<&2, String> -> List<&2, T>

template get_many source · line 4588 · raw

@-T:Data -> @-conv:(@_:String -> T) -> @f:Field -> List<&2, T>

template sample_bugs source · line 4970 · raw

@-A:Type -> @-decode:(@+m:Matches -> Dec(A)) -> @paths:List<&2, List<&2, String>> -> @+c:Cmd -> List<&2, Problem>

template check source · line 4979 · raw

@-A:Type -> @-decode:(@+m:Matches -> Dec(A)) -> @+c:Cmd -> List<&2, Problem>

template bash_arms source · line 6598 · raw

@-f:(@_:Stop -> List<&2, String>) -> @stops:List<&2, Stop> -> List<&2, String>

template eval source · line 7765 · raw

@-A:Type -> @-decode:(@+m:Matches -> Dec(A)) -> @c:Cmd -> @h:Host -> @argv:List<&2, String> -> Step<A>

The whole CLI as a function. It must stay a direct forwarding definition: P10 and P11 are proved of eval_with.

template eval_linted source · line 7777 · raw

@-A:Type -> @-decode:(@+m:Matches -> Dec(A)) -> @l:Linted -> @h:Host -> @argv:List<&2, String> -> Step<A>

eval on a Linted, without linting its spec again. It must stay a direct forwarding definition: P16, p10_linted and p11_linted are proved of eval_linted_with.

template ran_step source · line 7892 · raw

@-A:Type -> @-plan:(@+t:Term -> @_:A -> Ran) -> @s:Step<A> -> Ran

template invoke source · line 7901 · raw

@-A:Type -> @-decode:(@+m:Matches -> Dec(A)) -> @-plan:(@+t:Term -> @_:A -> Ran) -> @c:Cmd -> @h:Host -> @argv:List<&2, String> -> Ran

§7.2: what Run.planned writes and exits with, given the host and argv: Quit's code and text, or plan's run on the value and terminal, mapped by ran_act. plan builds its output whole, so an action that streams or does other IO is an act for Run.main instead.