Module Down_std.Cmd

Executing commands

type t = string list

The type for commands.

val of_string : string -> t

of_string s is a command from string s.

val exists : t -> (bool, string) Stdlib.result

exists cmd checks if the tool in cmd exists.

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

must_exist cmd checks the tool in cmd exists and fails with an error message otherwise.

val run : ?⁠stdout:string -> ?⁠stderr:string -> t -> (unit, int * string) Stdlib.result

run ~stdout ~stderr c run commands c and returns an error on non zero exit. stdout and stderr can be used to redirect the corresponding outputs to files.

val read : t -> (string, int * string) Stdlib.result

read c runs commands c and returns its standard input or non zero on exit.