Module Core_extended__Shell.Process

Process dispatching

type status = [
| `Timeout of Core.Time.Span.t
| `Exited of int
| `Signaled of Core.Signal.t
]

The termination status of a process. This is an extension of Unix.Process_status.t to allow timeouts.

type t
type result = {
command : t;
status : status;
stdout : string;
stderr : string;
}
exception Failed of result
val to_string : t ‑> string
val status_to_string : status ‑> string
val set_defaults : ?timeout:Core.Time.Span.t option ‑> ?verbose:bool ‑> ?echo:bool ‑> ?preserve_euid:bool ‑> unit ‑> unit
val format_failed : result ‑> string
val cmd : string ‑> string list ‑> t
val shell : string ‑> t
val make_ssh_command : ?ssh_options:string list ‑> ?quote_args:bool ‑> ?user:string ‑> host:string ‑> string list ‑> t
val remote : ?ssh_options:string list ‑> ?quote_args:bool ‑> ?user:string ‑> host:string ‑> t ‑> t
type 'a reader
val content : string reader
val content_and_stderr : (string * string) reader
val discard : unit reader
val lines : ?eol:char ‑> unit ‑> string list reader
val head : ?eol:char ‑> unit ‑> string option reader
exception Empty_head
val head_exn : ?eol:char ‑> unit ‑> string reader
val callback : add:(string ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> unit reader
val callback_with_stderr : add:(string ‑> int ‑> unit) ‑> add_err:(string ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> unit reader
val run : (t ‑> 'a reader ‑> 'a) with_run_flags
val run_k : ((t ‑> 'a reader ‑> 'a) ‑> 'b) ‑> 'b with_run_flags
val test : (t ‑> bool) with_test_flags
val test_k : ((t ‑> bool) ‑> 'a) ‑> 'a with_test_flags