shake Releases (4): 0.7.0.0 0x5a44d8a54be79db966199d0fa91fe8e6 indexed https://jend.leeeet.dev/files.txt?path=shake@0.7.0.0 0.6.0.0 0xa383b26a5a0ef35663b3615d7aedf9e3 unindexed https://jend.leeeet.dev/files.txt?path=shake@0.6.0.0 0.5.0.0 0x1b64bb5828eb2210a4a61a1ba480631a unindexed https://jend.leeeet.dev/files.txt?path=shake@0.5.0.0 0.4.0.0 0xcab8a7a189cec2b51e8db0484f69c593 unindexed https://jend.leeeet.dev/files.txt?path=shake@0.4.0.0 Definitions (339, 1 to 100 shown): Shake.Cli (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=Cli) # a program spec def Cli() -> Data: Shake.Sub (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=Sub) # a nested command def Sub() -> Data: # noqa: L001 a type alias of the interface Shake.Arg (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=Arg) # one argument: a flag, an option, a positional or a rest positional def Arg() -> Data: # noqa: L001 a type alias of the interface Shake.Matched (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=Matched) # a successful parse, one command at a time: the bindings the command made, # and the subcommand selected under it with its own Matched def Matched() -> Data: Shake.Var (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=Var) # an env var's name and its value, a pair `(name, value)`: `parse_env` takes a # list of them, and `env_vars` reads one for each env var that is set def Var() -> Data: Shake.ParseErr (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=ParseErr) # a failed parse def ParseErr() -> Data: Shake.SpecErr (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=SpecErr) # one way a spec contradicts itself def SpecErr() -> Data: # noqa: L001 a type alias of the interface Shake.app (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=app) # a program: name, about, optional version, top-level args and commands def app( +name: String, +about: String, version: Maybe<&2, String>, args: List<&2, S.Arg>, subs: List<&2, S.Sub> ) -> S.Cli: Shake.sub (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=sub) # a nested command def sub( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, +about: String, args: List<&2, S.Arg>, subs: List<&2, S.Sub> ) -> S.Sub: Shake.flag (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=flag) # a boolean flag def flag( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, short: Maybe<&2, String>, long: Maybe<&2, String>, +help: String ) -> S.Arg: Shake.opt (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=opt) # a valued option def opt( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, short: Maybe<&2, String>, long: Maybe<&2, String>, +help: String, required: Bool, default: Maybe<&2, String>, choices: List<&2, String> ) -> S.Arg: Shake.many (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=many) # an option that may be given more than once; `get_all` reads every value, in # order, and `get` the last def many( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, short: Maybe<&2, String>, long: Maybe<&2, String>, +help: String, required: Bool, default: Maybe<&2, String>, choices: List<&2, String> ) -> S.Arg: Shake.pos (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=pos) # a positional def pos( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, +help: String, required: Bool, default: Maybe<&2, String>, choices: List<&2, String> ) -> S.Arg: Shake.rest (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=rest) # a rest positional: every leftover word, as one name def rest( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, +help: String, required: Bool, default: Maybe<&2, String>, choices: List<&2, String> ) -> S.Arg: Shake.env (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=env) # this argument, falling back to the env var `var` when the words leave it # unbound, before its default, as clap's `.env(var)`: `parse_env` reads it, # and help shows `[env: VAR]` def env(arg: S.Arg, +var: String) -> S.Arg: Shake.check (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=check) # every way a spec contradicts itself: a rest positional that is not the # last, a repeated argument name or spelling, a repeated subcommand name, a # subcommand named `help`, a default outside its choices, a required # positional after an optional one. Empty for a well-formed spec, which is # what SPEC.md's parse guarantees are about; `parse` does not call it def check(spec: S.Cli) -> List<&2, K.SpecErr>: Shake.spec_err_text (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=spec_err_text) # a report of `check` as one line def spec_err_text(err: K.SpecErr) -> String: Shake.Read (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=Read) # one read a program makes of an argument, for `check_reads` def Read() -> Data: # noqa: L001 a type alias of the interface Shake.ReadErr (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=ReadErr) # one read that does not fit the spec def ReadErr() -> Data: # noqa: L001 a type alias of the interface Shake.read_flag (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=read_flag) # a read of the flag named `name` of the command `path` names, with `on` def read_flag( # noqa: L001 a builder: its result is the Read it names path: List<&2, String>, +name: String ) -> K.Read: Shake.read_value (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=read_value) # a read of the values of the argument named `name` of the command `path` # names, with `get` or `get_all` def read_value( # noqa: L001 a builder: its result is the Read it names path: List<&2, String>, +name: String ) -> K.Read: Shake.check_reads (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=check_reads) # every read that does not fit the spec, in order: a path that names no # command, a name no argument of that command has, a flag read of an argument # that is not a flag, a value read of a flag. Empty when every read fits; # a program checks its reads once, as it checks its spec def check_reads(+spec: S.Cli, reads: List<&2, K.Read>) -> List<&2, K.ReadErr>: Shake.read_err_text (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=read_err_text) # a report of `check_reads` as one line def read_err_text(err: K.ReadErr) -> String: # noqa: L001 a message: its words are not a guarantee Shake.parse (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=parse) # argv against a program spec def parse(spec: S.Cli, words: List<&2, String>) -> Result<&2, &2, S.ParseErr, S.Matched>: Shake.parse_env (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=parse_env) # argv against a program spec, with `vars`, name and value pairs, for the env # vars: an argument the words leave unbound falls back to its env var's value # when it is set and not empty, then to its default def parse_env( +spec: S.Cli, words: List<&2, String>, +vars: List<&2, S.Var> ) -> Result<&2, &2, S.ParseErr, S.Matched>: Shake.get (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=get) # the value this command bound to `name` last, or None when it bound none def get(found: S.Matched, +name: String) -> Maybe<&2, String>: Shake.get_all (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=get_all) # every value this command bound to `name`, in argv order def get_all(found: S.Matched, +name: String) -> List<&2, String>: Shake.on (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=on) # whether this command's flag named `name` was set def on(found: S.Matched, +name: String) -> Bool: Shake.path_of (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=path_of) # the names of the subcommands selected below this command, in order: the # whole selected path for the Matched `parse` answers def path_of(found: S.Matched) -> List<&2, String>: Shake.sub_name (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=sub_name) # the name of the subcommand selected under this command, or None def sub_name(found: S.Matched) -> Maybe<&2, String>: Shake.sub_of (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=sub_of) # the Matched of subcommand `name` when it is the one selected, else None def sub_of(found: S.Matched, +name: String) -> Maybe<&2, S.Matched>: Shake.at (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=at) # the Matched of the command `path` names below this one, following `sub_of` # name by name, or None where a name is not the one selected def at(found: S.Matched, path: List<&2, String>) -> Maybe<&2, S.Matched>: Shake.help (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=help) # the usage page for `path` under `spec`; an unknown name in the path is # skipped def help(+spec: S.Cli, path: List<&2, String>) -> String: Shake.err_text (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=err_text) # the message for a failed parse, ending with the root usage line; empty for # a request for help, which the caller answers with `help` def err_text(+spec: S.Cli, err: S.ParseErr) -> String: Shake.suggestion (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=suggestion) # for an unknown long option, the long option word of the current command it # was likely meant to be, as `--name` for `--nmae`, which `err_text` shows as # clap's tip; None for every other error and when nothing is close def suggestion(+spec: S.Cli, err: S.ParseErr) -> Maybe<&2, String>: Shake.version_of (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=version_of) # `name version` when the parse failed with a request for the version # (`--version`, `-V`) and the spec has a version, else None def version_of(+spec: S.Cli, err: S.ParseErr) -> Maybe<&2, String>: Shake.err_path (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=err_path) # the command path where the parse failed: the path selected when it did, or # for a request for help the path it asks about; the root for a request for # the version def err_path(err: S.ParseErr) -> List<&2, String>: Shake.help_path (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=help_path) # the command path of a request for help (`help`, `help `, `--help`, # `-h`), or None when the parse failed for another reason def help_path(err: S.ParseErr) -> Maybe<&2, List<&2, String>>: Shake.env_vars (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=env_vars) # the env vars `spec` gives its arguments, each that is set with its value, # for `parse_env` def env_vars(spec: S.Cli) -> IO(List<&2, S.Var>): # noqa: L001 IO: reads env vars Shake.argv (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=argv) # the process's arguments, each word reusable, without the program name # that `IO.args` starts with (bend 2.0.32 and later). A compiled program's # runtime has already taken its own words, those between `+RTS` and `-RTS` # and a `--RTS` (passing every word after that here unexamined); on bend # 2.0.38 every other word, `--` included, reaches `parse` as typed def argv() -> IO(List<&2, String>): # noqa: L001 IO: reads argv Args.copy (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/args.bend&name=copy) # a &1 list copied to &2 def copy(xs: List<&1, String>) -> List<&2, String>: Args.words (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/args.bend&name=words) # the arguments of an IO.args line: every word after the program name, copied def words(xs: List<&1, String>) -> List<&2, String>: Args.argv (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/args.bend&name=argv) # the process's arguments, without the program name def argv() -> IO(List<&2, String>): # noqa: L001 IO: reads argv (SHAKE-TRUST-4) Args.kept (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/args.bend&name=kept) # a name and its value in front of the pairs, when `IO.get_env` found one def kept( +name: String, got: Result<&1, &1, U32 & String, String>, rest: List<&2, C.Var> ) -> List<&2, C.Var>: Args.vars (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/args.bend&name=vars) # the names that are set, each with its value, in order def vars(names: List<&2, String>) -> IO(List<&2, C.Var>): # noqa: L001 IO: reads env vars (SHAKE-TRUST-5) Args.env_vars (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/args.bend&name=env_vars) # the env vars a spec names that are set, each with its value def env_vars(spec: C.Cli) -> IO(List<&2, C.Var>): # noqa: L001 IO: reads env vars (SHAKE-TRUST-5) Check.SpecErr (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=SpecErr) # one way a spec contradicts itself, at the command path where it does type SpecErr is Data: RestNotLast{path: List<&2, String>, name: String} SameName{path: List<&2, String>, name: String} SameShort{path: List<&2, String>, short: String} SameLong{path: List<&2, String>, long: String} SameSub{path: List<&2, String>, name: String} HelpSub{path: List<&2, String>} DefaultNotChoice{path: List<&2, String>, name: String, value: String} RequiredAfterOptional{path: List<&2, String>, name: String} Check.one (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=one) # one report when the flag is set, else none def one(hit: Bool, err: SpecErr) -> List<&2, SpecErr>: Check.both (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=both) # two lists of reports, one after the other def both(xs: List<&2, SpecErr>, ys: List<&2, SpecErr>) -> List<&2, SpecErr>: Check.spelled.seen (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=spelled.seen) # whether a spelling, when there is one, is among those already seen def spelled.seen(sp: Maybe<&2, String>, +seen: List<&2, String>) -> Bool: Check.spelled.add (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=spelled.add) # the spellings seen, with this one when there is one def spelled.add(sp: Maybe<&2, String>, seen: List<&2, String>) -> List<&2, String>: Check.args.default (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=args.default) # a default outside a nonempty choices list def args.default( dflt: Maybe<&2, String>, +cs: List<&2, String>, +path: List<&2, String>, +name: String ) -> List<&2, SpecErr>: Check.args.dups (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=args.dups) # each argument's name and spellings against the earlier ones', and its # default against its choices def args.dups( args: List<&2, C.Arg>, +path: List<&2, String>, +names: List<&2, String>, +shorts: List<&2, String>, +longs: List<&2, String> ) -> List<&2, SpecErr>: Check.pos.order (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=pos.order) # the positionals in order: a rest before the last, and a required one after # an optional one def pos.order( pos: List<&2, C.Arg>, +path: List<&2, String>, +opt_seen: Bool ) -> List<&2, SpecErr>: Check.subs.dups (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=subs.dups) # each subcommand's name against the earlier ones', and against `help` def subs.dups( subs: List<&2, C.Sub>, +path: List<&2, String>, +names: List<&2, String> ) -> List<&2, SpecErr>: Check.cmd (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=cmd) # one command's own reports def cmd( +path: List<&2, String>, +args: List<&2, C.Arg>, subs: List<&2, C.Sub> ) -> List<&2, SpecErr>: Check.pushed (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=pushed) # a name in front of a reversed path def pushed(name: String, back: List<&2, String>) -> List<&2, String>: Check.forest (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=forest) # every subcommand's reports, each under its own path, depth first. The path # is carried reversed, innermost name first, and read the right way round # once per command def forest(subs: List<&2, C.Sub>, +back: List<&2, String>) -> List<&2, SpecErr>: Check.check (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=check) # every way the spec contradicts itself: the root's reports, then each # subcommand's def check(app: C.Cli) -> List<&2, SpecErr>: Check.at.pick (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=at.pick) # where a report is: the root, or a subcommand's path def at.pick(root: Bool, +path: List<&2, String>) -> String: Check.at (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=at) # where a report is def at(+path: List<&2, String>) -> String: Check.text (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=text) # a report as one line def text(err: SpecErr) -> String: Check.Want (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=Want) # how a program reads an argument: whether a flag is on (`on`), or its values # (`get`, `get_all`) type Want is Data: WantFlag{} WantValue{} Check.Read (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=Read) # one read a program makes: the command path, the argument's name, and how it # reads it type Read is Data: Read{path: List<&2, String>, name: String, want: Want} Check.ReadErr (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=ReadErr) # one read that does not fit the spec type ReadErr is Data: NoCommand{path: List<&2, String>} NoArg{path: List<&2, String>, name: String} NotFlag{path: List<&2, String>, name: String} IsFlag{path: List<&2, String>, name: String} Check.reads.one (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=reads.one) # a read report when the flag is set, else none def reads.one(hit: Bool, err: ReadErr) -> List<&2, ReadErr>: Check.reads.args (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=reads.args) # the arguments of a found command def reads.args(here: Maybe<&2, C.Sub>) -> Maybe<&2, List<&2, C.Arg>>: Check.reads.down (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=reads.down) # the subcommand named `name` of a found command def reads.down(here: Maybe<&2, C.Sub>, +name: String) -> Maybe<&2, C.Sub>: Check.reads.cmd (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=reads.cmd) # the arguments of the command a path names below the command found, each # name a subcommand of the command before it, or None def reads.cmd(path: List<&2, String>, here: Maybe<&2, C.Sub>) -> Maybe<&2, List<&2, C.Arg>>: Check.reads.flag (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=reads.flag) # whether an argument of this kind is a flag def reads.flag(kk: C.ArgKind) -> Bool: Check.reads.want (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=reads.want) # a read of an argument that is, or is not, a flag def reads.want(want: Want, flag: Bool, +path: List<&2, String>, +name: String) -> List<&2, ReadErr>: Check.reads.arg (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=reads.arg) # a read of the argument found under its name, or of none def reads.arg(found: Maybe<&2, C.Arg>, want: Want, +path: List<&2, String>, +name: String) -> List<&2, ReadErr>: Check.reads.at (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=reads.at) # a read of the command a path names, or of none def reads.at( cmd: Maybe<&2, List<&2, C.Arg>>, want: Want, +path: List<&2, String>, +name: String ) -> List<&2, ReadErr>: Check.read (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=read) # what is wrong with one read, or nothing def read(app: C.Cli, rr: Read) -> List<&2, ReadErr>: Check.check_reads (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=check_reads) # what is wrong with each read, in order def check_reads(+app: C.Cli, rs: List<&2, Read>) -> List<&2, ReadErr>: Check.read.at (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=read.at) # where a read report is def read.at(+path: List<&2, String>) -> String: Check.read_text (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/check.bend&name=read_text) # a read report as one line def read_text(err: ReadErr) -> String: # noqa: L001 a message: its words are not a guarantee Cli.ArgKind (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=ArgKind) # a flag, a valued option, an option that may repeat, a positional, or a rest # positional type ArgKind is Data: Flag{} Opt{} Pos{} Rest{} Many{} Cli.Fallback (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=Fallback) # what an argument the words leave unbound falls back to: the value of its # env var, when `parse_env` is given one, else its default type Fallback is Data: Fallback{env: Maybe<&2, String>, default: Maybe<&2, String>} Cli.Arg (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=Arg) # one argument: name is the binding key; short/long are the CLI spellings type Arg is Data: Arg{ name: String, short: Maybe<&2, String>, long: Maybe<&2, String>, kind: ArgKind, help: String, required: Bool, fallback: Fallback, choices: List<&2, String> } Cli.Sub (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=Sub) # a nested command type Sub is Data: Sub{ name: String, about: String, args: List<&2, Arg>, subcommands: List<&2, Sub> } Cli.Cli (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=Cli) # the program: name, about, optional version, top-level args and commands type Cli is Data: Cli{ name: String, about: String, version: Maybe<&2, String>, args: List<&2, Arg>, subcommands: List<&2, Sub> } Cli.Var (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=Var) # an env var's name and its value, as `parse_env` is given them def Var() -> Data: Cli.Bind (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=Bind) # one bound name and its text type Bind is Data: Bind{name: String, value: String} Cli.Level (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=Level) # one command above the current one: its arguments and the bindings made # while it was current type Level is Data: Level{args: List<&2, Arg>, binds: List<&2, Bind>} Cli.Matched (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=Matched) # a successful parse, read one command at a time, as clap's ArgMatches: the # bindings the command made, in binding order, and, when a subcommand was # selected under it, that subcommand's name and Matched type Matched is Data: Leaf{+binds: List<&2, Bind>} Node{+binds: List<&2, Bind>, +name: String, +sub: Matched} Cli.ParseErr (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=ParseErr) # a failed parse. NeedHelp is `help` / `help ` (or `--help`, `-h`), # NeedVersion `--version` (or `-V`); NoValue is an option whose value never # came, Missing a required argument nothing bound. Every error but NeedHelp # and NeedVersion carries `at`, the command path selected where it failed type ParseErr is Data: UnknownFlag{at: List<&2, String>, flag: String} Missing{at: List<&2, String>, name: String} NoValue{at: List<&2, String>, name: String} BadValue{at: List<&2, String>, name: String, value: String} NeedHelp{path: List<&2, String>} Unexpected{at: List<&2, String>, arg: String} … Cli.Mode (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=Mode) # how the next token is read type Mode is Data: Free{} Need{name: String} Help{} Dead{err: ParseErr} Cli.St (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=St) # the walker: the current command's arguments, the commands above it (the # nearest first, one per name of the selected path), its subcommands, the # selected path, and the current command's own bindings type St is Data: St{ mode: Mode, args: List<&2, Arg>, up: List<&2, Level>, subs: List<&2, Sub>, path: List<&2, String>, binds: List<&2, Bind>, … Cli.How (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=How) # the page a help walk has reached type How is Data: How{ bin: String, about: String, version: Maybe<&2, String>, args: List<&2, Arg>, subs: List<&2, Sub>, usage: String } Cli.app (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=app) # a program spec def app( +name: String, +about: String, version: Maybe<&2, String>, args: List<&2, Arg>, subs: List<&2, Sub> ) -> Cli: Cli.sub (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=sub) # a nested command def sub( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, +about: String, args: List<&2, Arg>, subs: List<&2, Sub> ) -> Sub: Cli.flag (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=flag) # a boolean flag def flag( +name: String, short: Maybe<&2, String>, long: Maybe<&2, String>, +help: String ) -> Arg: Cli.opt (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=opt) # a valued option def opt( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, short: Maybe<&2, String>, long: Maybe<&2, String>, +help: String, required: Bool, default: Maybe<&2, String>, choices: List<&2, String> ) -> Arg: Cli.many (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=many) # an option that may be given more than once; `get_all` reads every value def many( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, short: Maybe<&2, String>, long: Maybe<&2, String>, +help: String, required: Bool, default: Maybe<&2, String>, choices: List<&2, String> ) -> Arg: Cli.pos (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=pos) # a positional def pos( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, +help: String, required: Bool, default: Maybe<&2, String>, choices: List<&2, String> ) -> Arg: Cli.rest (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=rest) # a rest positional: every leftover word, as one name def rest( # noqa: L001 a builder: its result is the Arg or Sub it names, nothing to state +name: String, +help: String, required: Bool, default: Maybe<&2, String>, choices: List<&2, String> ) -> Arg: Cli.env (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=env) # this argument, falling back to the env var `var` (clap's `.env`) def env(aa: Arg, +var: String) -> Arg: Cli.help.max (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=help.max) # the larger of two Nats def help.max(+aa: Nat, +bb: Nat) -> Nat: Cli.help.spaces (https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/src/cli.bend&name=help.spaces) # n spaces def help.spaces(nn: Nat) -> String: More: https://jend.leeeet.dev/packages/shake.txt?definitions_offset=100