rad/workbook
Types
A collection of tasks, each of which can be run from the rad
command line
interface.
A Workbook
can be conveniently built up using the following functions:
new
, followed by any number of task
, tasks
,
and delete
.
Any number of tasks can be added to a new
or existing Workbook
,
such as the standard workbook
, to
compose a custom Workbook
that can be given to
rad.do_main
.
pub type Workbook =
Map(List(String), Task(Result))
Functions
pub fn delete(from workbook: Map(
List(String),
Task(Result(String, Snag)),
), task path: List(String)) -> Map(
List(String),
Task(Result(String, Snag)),
)
pub fn from_tasks(list: List(Task(Result(String, Snag)))) -> Map(
List(String),
Task(Result(String, Snag)),
)
pub fn get(from workbook: Map(
List(String),
Task(Result(String, Snag)),
), task path: List(String)) -> Result(
Task(Result(String, Snag)),
Nil,
)
Results in the Task
with the given path
on success, or
Nil
on failure.
pub fn help(from workbook_fun: fn() ->
Map(List(String), Task(Result(String, Snag)))) -> fn(
CommandInput,
Task(Result(String, Snag)),
) -> Result(String, Snag)
pub fn info(config: Toml) -> Result(String, Snag)
Results in formatted information about rad
on success, or a
Snag
on failure.
pub fn new() -> Map(List(String), Task(Result(String, Snag)))
Returns a new, empty Workbook
.
pub fn section(named name: String, when cond: Bool, enum items: List(
a,
), with format_fun: fn(a) -> #(String, String), styled style: Map(
String,
List(String),
), sorted order_by: fn(String, String) -> Order) -> Option(
String,
)
pub fn task(into workbook: Map(
List(String),
Task(Result(String, Snag)),
), add task: Task(Result(String, Snag))) -> Map(
List(String),
Task(Result(String, Snag)),
)
pub fn tasks(into workbook: Map(
List(String),
Task(Result(String, Snag)),
), add tasks: List(Task(Result(String, Snag)))) -> Map(
List(String),
Task(Result(String, Snag)),
)