cswap-bend-cli Releases (1): 0.1.0.0 0x0717344745a30ebad1f19045228e8f18 indexed https://jend.leeeet.dev/files.txt?path=cswap-bend-cli@0.1.0.0 Definitions (4210, 1 to 100 shown): Act.of (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=of) def of(-A: Type) -> Type: Act.pure (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=pure) def pure(-A: Type, x: A) -> of(A): Act.fail (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=fail) def fail(-A: Type, code: U32, msg: String) -> of(A): Act.step (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=step) def step(-A: Type, -B: Type, r: Fs.Res(A), f: A -> of(B)) -> of(B): Act.bind (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=bind) def bind(-A: Type, -B: Type, m: of(A), f: A -> of(B)) -> of(B): Act.lift (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=lift) # Lift a plain IO value. def lift(-A: Type, m: IO(A)) -> of(A): Act.finally (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=finally) # Run `act` whatever `m` answered with, after it: for cleanup. def finally(-A: Type, act: of(A), cleanup: of(Unit)) -> of(A): Act.cond (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=cond) # a when `c`, else b. def cond(-A: Type, c: Bool, a: of(A), b: of(A)) -> of(A): Act.guard (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=guard) # Fail with (code, msg) unless `ok`. def guard(ok: Bool, code: U32, msg: String) -> of(Unit): Act.on_fail2 (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=on_fail2) def on_fail2(-A: Type, r: Fs.Res(A), cleanup: of(Unit)) -> of(A): Act.on_fail (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=on_fail) # Run `cleanup` only when `act` failed, and still answer the failure. def on_fail(-A: Type, act: of(A), cleanup: of(Unit)) -> of(A): Args.Parsed (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=Parsed) type Parsed is Data: PHelp{} PVersion{} PList{json: Bool, token_status: Bool} PStatus{json: Bool} PAdd{slot: Maybe<&2, U32>, alias: Maybe<&2, String>} PAddToken{token: Maybe<&2, String>, email: Maybe<&2, String>, slot: Maybe<&2, U32>} PRemove{ident: String} PImportUsage{path: String, hold: Maybe<&2, U32>} PConfig{args: List<&2, String>, json: Bool} PProfile{args: List<&2, String>, json: Bool} … Args.Opt (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=Opt) # One token of the command line: a flag with its value ("" for a switch), or a # positional (empty name). type Opt is Data: Opt{name: String, value: String} Args.KV (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=KV) type KV is Data: KV{k: String, v: String} Args.verbs (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=verbs) def verbs() -> List<&2, KV>: Args.verb.step (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=verb.step) def verb.step(hit: Bool, v: String, rest: Maybe<&2, String>) -> Maybe<&2, String>: Args.verb.find (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=verb.find) def verb.find(+t: String, vs: List<&2, KV>) -> Maybe<&2, String>: Args.verb.pick (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=verb.pick) def verb.pick(+t: String) -> String: Args.verb_of (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=verb_of) # The canonical verb a first token names, "" when it is none. def verb_of(+t: String) -> String: Args.valued (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=valued) def valued() -> List<&2, String>: Args.switches (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=switches) def switches() -> List<&2, String>: Args.has_str (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=has_str) def has_str(+x: String, xs: List<&2, String>) -> Bool: Args.is_flag (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=is_flag) def is_flag(+t: String) -> Bool: Args.split_eq.go (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=split_eq.go) def split_eq.go(ps: List<&2, String>) -> String & Maybe<&2, String>: Args.split_eq (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=split_eq) # `--slot=3` as ("--slot", "3"); a bare flag has no value part. def split_eq(+t: String) -> String & Maybe<&2, String>: Args.opt.has (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=opt.has) def opt.has(+name: String, os: List<&2, Opt>) -> Bool: Args.opt.pick (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=opt.pick) def opt.pick(hit: Bool, v: String, rest: Maybe<&2, String>) -> Maybe<&2, String>: Args.opt.val (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=opt.val) def opt.val(+name: String, os: List<&2, Opt>) -> Maybe<&2, String>: Args.pos.pick (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=pos.pick) def pos.pick(hit: Bool, v: String, rest: List<&2, String>) -> List<&2, String>: Args.positionals (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=positionals) def positionals(os: List<&2, Opt>) -> List<&2, String>: Args.first_of (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=first_of) def first_of(xs: List<&2, String>) -> Maybe<&2, String>: Args.prog (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=prog) def prog() -> String: Args.usage_line (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=usage_line) def usage_line() -> String: Args.flag.msg (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=flag.msg) def flag.msg(on: Bool, msg: String, rest: String) -> String: Args.first.pick (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=first.pick) def first.pick(empty: Bool, rest: String, h: String) -> String: Args.first_err (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=first_err) def first_err(msgs: List<&2, String>) -> String: Args.err_if (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=err_if) def err_if(on: Bool, msg: String) -> String: Args.pos_err (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=pos_err) def pos_err(+vb: String, +ps: List<&2, String>, +max: Nat) -> String: Args.strategy_err (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=strategy_err) def strategy_err(m: Maybe<&2, String>) -> String: Args.common_errs (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=common_errs) def common_errs(+vb: String, +os: List<&2, Opt>) -> List<&2, String>: Args.Slot (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=Slot) type Slot is Data: SlotOk{n: Maybe<&2, U32>} SlotBad{msg: String} Args.slot.read (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=slot.read) def slot.read(r: Maybe<&2, U32>, +s: String) -> Slot: Args.slot.of (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=slot.of) def slot.of(m: Maybe<&2, String>) -> Slot: Args.Hold (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=Hold) type Hold is Data: HoldOk{secs: Maybe<&2, U32>} HoldBad{msg: String} Args.hold.bad (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=hold.bad) def hold.bad() -> Hold: Args.hold.int (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=hold.int) def hold.int(r: Maybe<&2, U32>) -> Hold: Args.hold.parts (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=hold.parts) def hold.parts(ps: List<&2, String>) -> Hold: Args.hold.norm (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=hold.norm) def hold.norm(m: Maybe<&2, String>) -> Hold: Args.hold.of (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=hold.of) def hold.of(m: Maybe<&2, String>) -> Hold: Args.bad_text (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=bad_text) def bad_text(msg: String) -> String: Args.bad (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=bad) def bad(msg: String) -> Parsed: Args.sel.p (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=sel.p) def sel.p(c: Bool, a: Parsed, b: Parsed) -> Parsed: Args.with_err (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=with_err) def with_err(+e: String, p: Parsed) -> Parsed: Args.build.add (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=build.add) def build.add(sl: Slot, alias: Maybe<&2, String>) -> Parsed: Args.build.token (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=build.token) def build.token(sl: Slot, token: Maybe<&2, String>, email: Maybe<&2, String>) -> Parsed: Args.build.import (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=build.import) def build.import(h: Hold, path: Maybe<&2, String>) -> Parsed: Args.build.remove (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=build.remove) def build.remove(m: Maybe<&2, String>) -> Parsed: Args.max_pos (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=max_pos) def max_pos(one: Bool) -> Nat: Args.arity (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=arity) def arity(+vb: String, +ps: List<&2, String>) -> String: Args.Alt (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=Alt) # A verb and the command it builds. type Alt is Data: Alt{key: String, val: Parsed} Args.choose.pick (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=choose.pick) def choose.pick(hit: Bool, v: Parsed, rest: Parsed) -> Parsed: Args.choose (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=choose) def choose(+vb: String, alts: List<&2, Alt>, dflt: Parsed) -> Parsed: Args.build.cmd (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=build.cmd) def build.cmd(+vb: String, +os: List<&2, Opt>, +ps: List<&2, String>) -> Parsed: Args.build.go (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=build.go) def build.go(+vb: String, +os: List<&2, Opt>, +ps: List<&2, String>) -> Parsed: Args.build.verb (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=build.verb) def build.verb(+vb: String, +os: List<&2, Opt>) -> Parsed: Args.build (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=build) def build(+vb: String, +os: List<&2, Opt>) -> Parsed: Args.not_flag (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=not_flag) def not_flag(+t: String) -> Bool: Args.config.keep (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=config.keep) def config.keep(keep: Bool, h: String, rest: List<&2, String>) -> List<&2, String>: Args.config_args (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=config_args) def config_args(ts: List<&2, String>) -> List<&2, String>: Args.Scan (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=Scan) type Scan is Data: Scan{opts: List<&2, Opt>, pending: String, err: String} Args.sel.s (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=sel.s) def sel.s(c: Bool, a: String, b: String) -> String: Args.first_msg (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=first_msg) def first_msg(+err: String, +name: String) -> String: Args.scan.fail (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.fail) def scan.fail(err: String, +name: String) -> String: Args.scan.flag2 (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.flag2) def scan.flag2(valued: Bool, switch: Bool, +name: String, inline: Maybe<&2, String>, opts: List<&2, Opt>, err: String) -> Scan: Args.scan.flag (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.flag) def scan.flag(kv: String & Maybe<&2, String>, opts: List<&2, Opt>, err: String) -> Scan: Args.scan.free (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.free) def scan.free(flag: Bool, +t: String, opts: List<&2, Opt>, err: String) -> Scan: Args.scan.step2 (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.step2) def scan.step2(pending: Bool, +h: String, +name: String, opts: List<&2, Opt>, err: String) -> Scan: Args.scan.step (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.step) def scan.step(+h: String, sc: Scan) -> Scan: Args.scan.go (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.go) def scan.go(ts: List<&2, String>, sc: Scan) -> Scan: Args.scan.dangling (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.dangling) def scan.dangling(+pending: String, err: String) -> String: Args.scan.end (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.end) def scan.end(sc: Scan) -> Scan: Args.scan (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan) def scan(ts: List<&2, String>) -> Scan: Args.scan.done (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=scan.done) def scan.done(+err: String, +vb: String, +opts: List<&2, Opt>) -> Parsed: Args.parse.scan (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=parse.scan) def parse.scan(+vb: String, sc: Scan) -> Parsed: Args.parse.verb (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=parse.verb) def parse.verb(+vb: String, +rest: List<&2, String>) -> Parsed: Args.parse.first (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=parse.first) def parse.first(+vb: String, +h: String, +rest: List<&2, String>) -> Parsed: Args.parse (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=parse) # The command a command line asks for, or the usage error (PBad) argparse # would print. def parse(ts: List<&2, String>) -> Parsed: B64.utf8.cat.pick (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.cat.pick) def utf8.cat.pick(a: Bool, b: Bool, d: Bool, +c: U32, rest: List<&2, U32>) -> List<&2, U32>: B64.utf8.cat (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.cat) def utf8.cat(+c: U32, rest: List<&2, U32>) -> List<&2, U32>: B64.utf8.encode (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.encode) # The UTF-8 bytes of a string. def utf8.encode(s: String) -> List<&2, U32>: B64.sel (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=sel) def sel(c: Bool, x: U32, y: U32) -> U32: B64.sel.b (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=sel.b) def sel.b(c: Bool, x: Bool, y: Bool) -> Bool: B64.utf8.len (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.len) # Continuation bytes a lead byte announces. def utf8.len(+b: U32) -> U32: B64.utf8.mask (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.mask) def utf8.mask(+n: U32) -> U32: B64.utf8.need (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.need) # The decoder state is (need, cp): continuation bytes still due and the code # point so far. These three give the next need, the next cp, and whether cp # is complete. def utf8.need(+b: U32, +need: U32) -> U32: B64.utf8.cp (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.cp) def utf8.cp(+b: U32, +need: U32, +cp: U32) -> U32: B64.utf8.emit (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.emit) def utf8.emit(+b: U32, +need: U32) -> Bool: B64.utf8.put (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.put) def utf8.put(emit: Bool, c: U32, rest: String) -> String: B64.utf8.decode.go (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.decode.go) # Decode UTF-8 bytes (lenient on malformed input). def utf8.decode.go(bs: List<&2, U32>, +need: U32, +cp: U32) -> String: B64.utf8.decode (https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/b64.bend&name=utf8.decode) def utf8.decode(bs: List<&2, U32>) -> String: More: https://jend.leeeet.dev/packages/cswap-bend-cli.txt?definitions_offset=100