diff options
-rw-r--r-- | it_pipe.class | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/it_pipe.class b/it_pipe.class index ea3010d..7408f69 100644 --- a/it_pipe.class +++ b/it_pipe.class @@ -226,10 +226,15 @@ function lines() } /** - * Pipe our contents through a shell command + * Pipe our contents through a shell command. + * @param $cmd command to execute, with {foo} for parameters + * @param $args assoc array of arguments, see it::exec */ -function pipe($cmd) +function pipe(/* $cmd, $args */) { + $args = func_get_args(); + $cmd = call_user_func_array('it::shell_command', $args); + $descriptors = array(0 => array("pipe", "r"), 1 => array("pipe", "w")); $process = proc_open($cmd, $descriptors, $pipes); |