~/bend-docscommunity

setcmd.bend checks

raw source on the hub · import cswap-bend-cli@0.1.0.0/setcmd.bend as Setcmd

9 imports
import Base
import ./setload.bend as Setload
import ./setwrite.bend as Setwrite
import ./fs/write.bend as FWrite
import ./json.bend as Json
import ./fs.bend as Fs
import ./act.bend as Act
import ./cmd.bend as Cmd
import ./settings.bend as Settings

Types

type Plan source · line 187 · raw

Data

Definitions

def ActM source · line 11 · raw

@-A:Type -> Type

def ActM.pure source · line 14 · raw

@-A:Type -> @x:A -> 0x0717344745a30ebad1f19045228e8f18/act.of(A)

def ActM.bind source · line 17 · raw

@-A:Type -> @-B:Type -> @m:0x0717344745a30ebad1f19045228e8f18/act.of(A) -> @f:(@_:A -> 0x0717344745a30ebad1f19045228e8f18/act.of(B)) -> 0x0717344745a30ebad1f19045228e8f18/act.of(B)

def err.msg source · line 20 · raw

@e:Pair(U32, String) -> String

def fin source · line 25 · raw

@r:0x0717344745a30ebad1f19045228e8f18/fs.Res(0x0717344745a30ebad1f19045228e8f18/cmd.Out) -> 0x0717344745a30ebad1f19045228e8f18/cmd.Out

The text of a failed Act as the command's output (exit 1).

def read_w.obj source · line 32 · raw

@+p:String -> @j:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/act.of(0x0717344745a30ebad1f19045228e8f18/json.Json)

def read_w.parse source · line 39 · raw

@+p:String -> @r:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> 0x0717344745a30ebad1f19045228e8f18/act.of(0x0717344745a30ebad1f19045228e8f18/json.Json)

def read_w.text source · line 46 · raw

@+p:String -> @r:0x0717344745a30ebad1f19045228e8f18/fs.Res(String) -> 0x0717344745a30ebad1f19045228e8f18/act.of(0x0717344745a30ebad1f19045228e8f18/json.Json)

def read_w.go source · line 53 · raw

@+p:String -> @ex:Bool -> 0x0717344745a30ebad1f19045228e8f18/act.of(0x0717344745a30ebad1f19045228e8f18/json.Json)

def load_raw_w source · line 62 · raw

@+root:String -> 0x0717344745a30ebad1f19045228e8f18/act.of(0x0717344745a30ebad1f19045228e8f18/json.Json)

settings.json for a read-modify-write: a missing file is {}, a torn or non-object file is an error (never replaced by a near-Setload.empty one).

def write_settings source · line 66 · raw

@+root:String -> @+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/act.of(Unit)

Atomic 0600 write of settings.json; the backup dir is made and set 0700.

def list.show source · line 72 · raw

@+root:String -> @json:Bool -> @+rs:List<&2, 0x0717344745a30ebad1f19045228e8f18/setwrite.Row> -> 0x0717344745a30ebad1f19045228e8f18/cmd.Out

def list.out source · line 80 · raw

@+root:String -> @json:Bool -> @raw:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/cmd.Out

def run.list source · line 83 · raw

@+root:String -> @json:Bool -> IO(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def get.show2 source · line 86 · raw

@json:Bool -> @+sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> @value:0x0717344745a30ebad1f19045228e8f18/json.Json -> @set:Bool -> @text:String -> 0x0717344745a30ebad1f19045228e8f18/cmd.Out

def get.show source · line 94 · raw

@json:Bool -> @+r:0x0717344745a30ebad1f19045228e8f18/setwrite.Row -> 0x0717344745a30ebad1f19045228e8f18/cmd.Out

def get.row source · line 99 · raw

@json:Bool -> @m:Maybe<&2, 0x0717344745a30ebad1f19045228e8f18/setwrite.Row> -> 0x0717344745a30ebad1f19045228e8f18/cmd.Out

def get.spec source · line 106 · raw

@json:Bool -> @r:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/settings.Spec> -> @raw:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/cmd.Out

def run.get source · line 113 · raw

@+root:String -> @key:String -> @json:Bool -> IO(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def set.msg source · line 116 · raw

@+sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> @+v:0x0717344745a30ebad1f19045228e8f18/json.Json -> String

def set.act source · line 119 · raw

@+root:String -> @+sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> @+v:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/act.of(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def set.parsed source · line 125 · raw

@+root:String -> @sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> @p:0x0717344745a30ebad1f19045228e8f18/setwrite.Parsed -> IO(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def set.spec source · line 132 · raw

@+root:String -> @r:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/settings.Spec> -> @value:String -> IO(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def run.set source · line 139 · raw

@+root:String -> @key:String -> @value:String -> IO(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def dflt_of source · line 142 · raw

@sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> 0x0717344745a30ebad1f19045228e8f18/json.Json

def unset.msg source · line 147 · raw

@+sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> String

def unset.write source · line 150 · raw

@+root:String -> @+sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> @+raw:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/act.of(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def unset.pick source · line 155 · raw

@present:Bool -> @+root:String -> @+sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> @+raw:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/act.of(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def section_of_spec source · line 162 · raw

@sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> String

def key_of source · line 167 · raw

@sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> String

def unset.act source · line 172 · raw

@+root:String -> @+sp:0x0717344745a30ebad1f19045228e8f18/settings.Spec -> 0x0717344745a30ebad1f19045228e8f18/act.of(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def unset.spec source · line 177 · raw

@+root:String -> @r:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/settings.Spec> -> IO(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def run.unset source · line 184 · raw

@+root:String -> @key:String -> IO(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def join_sp source · line 195 · raw

@xs:List<&1, String> -> String

def plan.none source · line 205 · raw

@rest:List<&1, String> -> @p:Plan -> Plan

Extra words after a complete verb are an argparse error.

def plan.get source · line 212 · raw

@rest:List<&1, String> -> Plan

def plan.unset source · line 219 · raw

@rest:List<&1, String> -> Plan

def plan.set source · line 226 · raw

@rest:List<&1, String> -> Plan

def plan.verb source · line 235 · raw

@l:Bool -> @g:Bool -> @s:Bool -> @u:Bool -> @p:Bool -> @a:String -> @rest:List<&1, String> -> Plan

def plan.of source · line 251 · raw

@args:List<&1, String> -> Plan

config [list | get KEY | set KEY VALUE | unset KEY | path], flags removed.

def plan.gate source · line 258 · raw

@json:Bool -> @p:Plan -> Plan

def plan.json source · line 265 · raw

@json:Bool -> @p:Plan -> Plan

def run source · line 278 · raw

@+root:String -> @p:Plan -> @json:Bool -> IO(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

def config source · line 295 · raw

@+root:String -> @args:List<&1, String> -> @+json:Bool -> IO(0x0717344745a30ebad1f19045228e8f18/cmd.Out)

cswap config ARGS...: args are the words after config with the --json / --debug flags already taken off, json the --json flag.