Allow any number of jq-coded function arguments
This commit is contained in:
1 parent
4249bbf0d5
commit
8cddb7c681
2 files changed
+23
-28
No files matched your search
@@ -473,6 +473,11 @@ def f(a;b;c;d;e;f): [a+1,b,c,d,e,f]; f(.[0];.[1];.[0];.[0];.[0];.[0])
|
||||
[1,2]
|
||||
[2,2,1,1,1,1]
|
||||
|
||||
# Many arguments
|
||||
def f(a;b;c;d;e;f;g;h;i;j): [j,i,h,g,f,e,d,c,b,a]; f(.[0];.[1];.[2];.[3];.[4];.[5];.[6];.[7];.[8];.[9])
|
||||
[0,1,2,3,4,5,6,7,8,9]
|
||||
[9,8,7,6,5,4,3,2,1,0]
|
||||
|
||||
([1,2] + [4,5])
|
||||
[1,2,3]
|
||||
[1,2,4,5]
|
||||
|
||||
Reference in new issue
Block a user