summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
Diffstat (limited to 'it.class')
-rw-r--r--it.class8
1 files changed, 6 insertions, 2 deletions
diff --git a/it.class b/it.class
index 13e3aa0..6e294c3 100644
--- a/it.class
+++ b/it.class
@@ -1226,9 +1226,13 @@ static function cat($p = null)
* @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
*/
-static function pipe($cmd, $args = array())
+static function pipe($cmd, ...$args)
{
- return new it_pipe(is_string($cmd) ? array('cmd' => $cmd, 'args' => $args) : array('data' => $cmd));
+ $values = [];
+ foreach ($args as $arg)
+ $values = array_merge($values, (array)$arg);
+
+ return new it_pipe(is_string($cmd) ? array('cmd' => $cmd, 'args' => $values) : array('data' => $cmd));
}
/**