From 46fbc3b82f409e34ac295fa3ba245e578f073a9b Mon Sep 17 00:00:00 2001 From: Fardale Date: Wed, 21 Sep 2022 11:22:02 +0200 Subject: [PATCH] doc(Unix): add example from call_full --- src/unix/CCUnix.mli | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/unix/CCUnix.mli b/src/unix/CCUnix.mli index d2538696..ce82a841 100644 --- a/src/unix/CCUnix.mli +++ b/src/unix/CCUnix.mli @@ -29,11 +29,17 @@ val call_full : 'a (** [call_full cmd] wraps the result of [Unix.open_process_full cmd] into an object. It reads the full stdout and stderr of the subprocess before - returning. + returning. [cmd] can be a format string as in {!Printf}. + @param stdin if provided, the generator or string is consumed and fed to the subprocess input channel, which is then closed. @param bufsize buffer size used to read stdout and stderr. @param env environment to run the command in. + + Example: + {[ + # CCUnix.call_full "ls %s" (CCUnix.escape_str "/");; + ]} *) val call : @@ -42,7 +48,7 @@ val call : ?env:string array -> ('a, Buffer.t, unit, string * string * int) format4 -> 'a -(** [call cmd] is similar to [call_full cmd] but returns +(** [call cmd] is similar to {!call_full} but returns a tuple [stdout, stderr, errcode] instead of an object. *) val call_stdout :