From dd5bbcfa9accdfd79f8ca38b0a6a453617758663 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 18 Dec 2025 04:06:18 +0000 Subject: work/command-line-tool: Construct command-line bindings recursively. This is required for command-line bindings that have array values. --- ravanan/work/command-line-tool.scm | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/ravanan/work/command-line-tool.scm b/ravanan/work/command-line-tool.scm index 843e939..175a561 100644 --- a/ravanan/work/command-line-tool.scm +++ b/ravanan/work/command-line-tool.scm @@ -351,16 +351,29 @@ the G-expressions are inserted." @code{} objects may be strings or G-expressions. The G-expressions may reference @var{inputs} and @var{runtime} variables that must be defined in the context in which the G-expressions are inserted." + (define (value->command-line-binding position prefix value) + (let ((type (object-type value))) + (cond + ((cwl-array-type? type) + (command-line-binding position + prefix + type + (vector-map (cut value->command-line-binding + %nothing + %nothing + <>) + value) + %nothing)) + (else + (command-line-binding position prefix type value %nothing))))) + (define (argument->command-line-binding i argument) - (let ((value (assoc-ref* argument "valueFrom"))) - (command-line-binding (cond - ((assoc-ref argument "position") - => string->number) - (else i)) - (maybe-assoc-ref (just argument) "prefix") - (object-type value) - value - %nothing))) + (value->command-line-binding (cond + ((assoc-ref argument "position") + => string->number) + (else i)) + (maybe-assoc-ref (just argument) "prefix") + (assoc-ref* argument "valueFrom"))) (define (collect-bindings ids+inputs+types+bindings) (append-map id+input+type-tree+binding->command-line-binding -- cgit 1.4.1