about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--e2e-tests/jobs/command-line-tool-with-array-input.yaml3
-rw-r--r--e2e-tests/tests.yaml9
-rw-r--r--e2e-tests/tools/command-line-tool-with-array-input.scm3
-rw-r--r--ravanan/work/command-line-tool.scm17
4 files changed, 23 insertions, 9 deletions
diff --git a/e2e-tests/jobs/command-line-tool-with-array-input.yaml b/e2e-tests/jobs/command-line-tool-with-array-input.yaml
new file mode 100644
index 0000000..a0fc50c
--- /dev/null
+++ b/e2e-tests/jobs/command-line-tool-with-array-input.yaml
@@ -0,0 +1,3 @@
+messages:
+  - foo
+  - bar
diff --git a/e2e-tests/tests.yaml b/e2e-tests/tests.yaml
index d14b93a..6604e39 100644
--- a/e2e-tests/tests.yaml
+++ b/e2e-tests/tests.yaml
@@ -241,3 +241,12 @@
       class: File
       size: 13
       checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b
+- id: command-line-tool-with-array-input
+  doc: CommandLineTool with array input
+  tool: tools/command-line-tool-with-array-input.cwl
+  job: jobs/command-line-tool-with-array-input.yaml
+  output:
+    output_message:
+      class: File
+      size: 8
+      checksum: sha1$d53a205a336e07cf9eac45471b3870f9489288ec
diff --git a/e2e-tests/tools/command-line-tool-with-array-input.scm b/e2e-tests/tools/command-line-tool-with-array-input.scm
new file mode 100644
index 0000000..38a8722
--- /dev/null
+++ b/e2e-tests/tools/command-line-tool-with-array-input.scm
@@ -0,0 +1,3 @@
+(command #:inputs (messages #:type (array string))
+         #:run "echo" messages
+         #:outputs (output_message #:type stdout))
diff --git a/ravanan/work/command-line-tool.scm b/ravanan/work/command-line-tool.scm
index 29d47c4..95d69f5 100644
--- a/ravanan/work/command-line-tool.scm
+++ b/ravanan/work/command-line-tool.scm
@@ -408,15 +408,14 @@ be defined in the context in which the G-expressions are inserted."
               position
               prefix
               matched-type
-              (map (lambda (i input)
-                     (id+input+type-tree+binding->command-line-binding
-                      (list (append id (list i))
-                            input
-                            (assoc-ref type-tree "items")
-                            (maybe-assoc-ref (just type-tree)
-                                             "inputBinding"))))
-                   (iota (vector-length input))
-                   (vector->list input))
+              (vector-map-indexed (lambda (i input)
+                                    (id+input+type-tree+binding->command-line-binding
+                                     (list (append id (list i))
+                                           input
+                                           (assoc-ref type-tree "items")
+                                           (maybe-assoc-ref (just type-tree)
+                                                            "inputBinding"))))
+                                  input)
               (maybe-assoc-ref binding "itemSeparator")))
             (else
              (command-line-binding position