summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
Diffstat (limited to 'it.class')
-rw-r--r--it.class5
1 files changed, 5 insertions, 0 deletions
diff --git a/it.class b/it.class
index d6bd7a5..4d6d875 100644
--- a/it.class
+++ b/it.class
@@ -840,6 +840,11 @@ function cat($fn = null)
return new it_pipe(array('fn' => $fn));
}
+/**
+ * Create an it_pipe from a command or a lines array
+ * @param $cmd command to execute, or if it is an array, the lines to use
+ * @param $args named arguments to fill into cmd. see it::exec for usage
+ */
function pipe($cmd, $args = array())
{
return new it_pipe(is_string($cmd) ? array('cmd' => $cmd, 'args' => $args) : array('data' => $cmd));