type t =
{ name : string
; value : string option
}
let make name value = { name; value }
let t = Oenv.(Product.v make
+: string "NAME"
+: string "VALUE" |> option
|> close)
Oenv.read t
Custom types
Make custom type reader with custom combinator.
type flag = A | B
let of_string = function
| "A" -> Ok A
| "B" -> Ok B
| other -> Error (`Parse ("flag", other))
let flag = Oenv.custom ~secret:false "FLAG" of_string