~/bend-docscommunity

tui/run.bend relies on unsafe/foreign

raw source on the hub · import cswap-bend-cli@0.1.0.0/tui/run.bend as Run

8 imports
import Base
import ../fs.bend as Fs
import ../clock.bend as Clock
import ./fmt.bend as F
import ./model.bend as M
import ./view.bend as V
import ./read.bend as R
import ./num.bend as N

Types

type Opts source · line 24 · raw

Data

Definitions

def usage_text source · line 27 · raw

String

def set_interval source · line 32 · raw

@+o:Opts -> @+n:U32 -> Opts

def with_bad source · line 37 · raw

@+o:Opts -> @+msg:String -> Opts

def with_interval source · line 42 · raw

@+o:Opts -> @+v:Maybe<&2, U32> -> Opts

def with_once source · line 49 · raw

@+o:Opts -> Opts

def with_plain source · line 54 · raw

@+o:Opts -> Opts

def keep source · line 59 · raw

@+ok:Bool -> @+m:Maybe<&2, U32> -> Maybe<&2, U32>

def positive source · line 66 · raw

@+m:Maybe<&2, U32> -> Maybe<&2, U32>

def default_opts source · line 73 · raw

Opts

def env_pick source · line 78 · raw

@r:Result<&1, &1, Pair(U32, String), String> -> @+d:String -> String

def env_or source · line 85 · raw

@+name:String -> @+d:String -> IO(String)

def text_pick source · line 88 · raw

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

def read_text source · line 95 · raw

@+path:String -> IO(String)

def out_of source · line 98 · raw

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

def out_pick source · line 103 · raw

@r:Result<&1, &1, Pair(U32, String), Pair(U32, Pair(String, String))> -> String

def code_of source · line 110 · raw

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

def code_pick source · line 114 · raw

@r:Result<&1, &1, Pair(U32, String), Pair(U32, Pair(String, String))> -> U32

def tail_text source · line 122 · raw

@+path:String -> @+n:String -> IO(String)

The last lines of a file, "" when it is missing.

def local_off source · line 125 · raw

IO(U32)

def alive source · line 130 · raw

@+pid:Maybe<&2, U32> -> IO(Bool)

Is the daemon's pid alive? kill -0 answers without signalling.

def now_pick source · line 137 · raw

@+pinned:String -> @+real:U32 -> U32

def clock_now source · line 140 · raw

IO(U32)

def frame_of source · line 145 · raw

@+v:0x0717344745a30ebad1f19045228e8f18/tui/model.View -> @+version:String -> @+now:U32 -> @+off:U32 -> @+live:Bool -> @+seq_t:String -> @+cache_t:String -> @+status_t:String -> @+settings_t:String -> @+log_t:String -> String

def pid_of source · line 148 · raw

@+status_t:String -> Maybe<&2, U32>

def frame_io source · line 151 · raw

@+v:0x0717344745a30ebad1f19045228e8f18/tui/model.View -> @+version:String -> @+root:String -> @+state:String -> IO(String)

def clear source · line 165 · raw

String

def width_of source · line 175 · raw

@+cols:String -> U32

def color_of source · line 178 · raw

@+want:Bool -> @+no_color:String -> Bool

def opts_color source · line 181 · raw

@+o:Opts -> Bool

def opts_once source · line 186 · raw

@+o:Opts -> Bool

def opts_secs source · line 191 · raw

@+o:Opts -> U32

def once_frame source · line 196 · raw

@+v:0x0717344745a30ebad1f19045228e8f18/tui/model.View -> @+version:String -> @+root:String -> @+state:String -> IO(Unit)

def pick_mode source · line 199 · raw

@+once:Bool -> @+v:0x0717344745a30ebad1f19045228e8f18/tui/model.View -> @+version:String -> @+root:String -> @+state:String -> @+secs:U32 -> IO(Unit)

def run_with source · line 206 · raw

@+o:Opts -> @+version:String -> @+v:0x0717344745a30ebad1f19045228e8f18/tui/model.View -> @+root:String -> @+state:String -> IO(Unit)

def run source · line 209 · raw

@+o:Opts -> @+version:String -> @+cols:String -> @+no_color:String -> @+home:String -> @+state:String -> IO(Unit)

def opts_bad source · line 212 · raw

@+o:Opts -> String

def start2 source · line 217 · raw

@+o:Opts -> @+version:String -> @+cols:String -> @+no_color:String -> @+home:String -> @+st:String -> IO(Unit)

def start1 source · line 220 · raw

@+o:Opts -> @+version:String -> @+cols:String -> @+no_color:String -> @+home:String -> IO(Unit)

def start source · line 223 · raw

@+o:Opts -> @+version:String -> IO(Unit)

def reject source · line 230 · raw

@+msg:String -> IO(Unit)

def read_opt source · line 233 · raw

@+v:Maybe<&2, String> -> Maybe<&2, U32>

def step_pick source · line 240 · raw

@+once:Bool -> @+plain:Bool -> @+iv:Bool -> @+o:Opts -> @+a:String -> @+v:Maybe<&2, String> -> Opts

def step source · line 252 · raw

@+o:Opts -> @+a:String -> @+v:Maybe<&2, String> -> Opts

One argument: its effect on the options. v is the word after it.

def head_opt source · line 255 · raw

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

def tail_of source · line 262 · raw

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

def rest_after2 source · line 269 · raw

@+iv:Bool -> @+t:List<&2, String> -> List<&2, String>

def parse source · line 277 · raw

@+fuel:Nat -> @+args:List<&2, String> -> @+o:Opts -> Opts

fuel is the argument count, at least the number of steps.

def dispatch_pick source · line 286 · raw

@+ok:Bool -> @+o:Opts -> @+version:String -> IO(Unit)

def dispatch source · line 293 · raw

@+o:Opts -> @+version:String -> IO(Unit)

def share source · line 297 · raw

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

A reusable copy of an argument list (the elements are Data).

def main2 source · line 304 · raw

@+args:List<&2, String> -> @+version:String -> IO(Unit)

def main source · line 308 · raw

@args:List<&1, String> -> @version:String -> IO(Unit)

The entry the CLI dispatches tui to: args are the words after the verb.

Unsafe

unsafe forever source · line 168 · raw

@+v:0x0717344745a30ebad1f19045228e8f18/tui/model.View -> @+version:String -> @+root:String -> @+state:String -> @+secs:U32 -> IO(Unit)