Module B0.OS.Env

module Env: sig .. end
Environment variables


Variables


val var : string -> string option
var name is the value of the environment variable name, if defined.
val opt_var : string -> absent:string -> string
opt_var name ~absent is the value of the optionally defined environment variable name, if defined and absent if undefined.

Process environement


type t = string B0.String.map 
The type for process environments.
val empty : t
empty is String.Map.empty.
val current : unit -> t B0.result
current () is the current process environment.
val override : t -> by:t -> t
override env ~by:o overrides the definitions in env by o.
val of_assignments : ?init:t -> string list -> t B0.result
of_assignments ~init ss folds over strings in ss, cuts them at the first '=' character and adds the resulting pair to init (defaults to B0.OS.Env.empty). If the same variable is bound more than once, the last one takes over.
val to_assignments : t -> string list
to_assignments env is env's bindings as a list of strings of the form "var=value".