Module B00.Op.Spawn

module Spawn: sig .. end

Tool spawns.

Tool spawns

type stdo = [ `File of B0_std.Fpath.t | `Tee of B0_std.Fpath.t | `Ui ] 

The type for spawn standard outputs redirections.

type success_exits = int list 

The list of process exit codes that indicate success. If the list is empty this any exit code.

type t 

The type for process spawn operations.

val env : t -> B0_std.Os.Env.assignments

env s is the environment in which s runs.

val relevant_env : t -> B0_std.Os.Env.assignments

relevant_env s are the assignements of env s that should be taken into account for caching.

val cwd : t -> B0_std.Fpath.t

cwd s is the cwd with which s runs.

val stdin : t -> B0_std.Fpath.t option

stdin s is the file s uses as stdin (if any).

val stdout : t -> stdo

stdout s is the redirection s uses for stdout.

val stderr : t -> stdo

stderr s is the redirection s uses for stderr.

val success_exits : t -> success_exits

success_exits s is the list of process exit codes s that indicate success.

val tool : t -> B0_std.Cmd.tool

tool t is the spawned tool. Note that this has to be a full path at that point.

val args : t -> B0_std.Cmd.t

args s are the spawned tool arguments.

val stdo_ui : t -> (string, string) Stdlib.result option

stdo_ui sr is the standard outputs redirection contents of s once it has executed (if any).

val set_stdo_ui : t -> (string, string) Stdlib.result option -> unit

set_stdo_ui w ui sets w's standard output redirection contents to ui.

val result : t -> (B0_std.Os.Cmd.status, string) Stdlib.result

result s is the spawn result of s.

val set_result : t -> (B0_std.Os.Cmd.status, string) Stdlib.result -> unit

set_result s e the spawn result of s to e.


val pp_success_exits : int list B0_std.Fmt.t

pp_success_exits formats the success exits.

val pp_cmd : t B0_std.Fmt.t

pp_cmd formats the command issued by the spawn.

val pp_stdo_ui : elide:bool -> t B0_std.Fmt.t

pp_stdo_ui formats the standard output ui of the spawn. If elide is true elides long outputs.

val pp_result : (B0_std.Os.Cmd.status, string) Stdlib.result B0_std.Fmt.t

pp_result formats the command status of the spawn.

val pp : t B0_std.Fmt.t

pp formats a spawn.