diff options
| author | Arun Isaac | 2025-12-18 04:06:18 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-12-18 04:07:49 +0000 |
| commit | dd5bbcfa9accdfd79f8ca38b0a6a453617758663 (patch) | |
| tree | de693d7f8ce6294ef4790131495a722fd6dd1f01 | |
| parent | 8478863c8b3ce60ffd52a9cb3a2ffd993efb8ca2 (diff) | |
| download | ravanan-dd5bbcfa9accdfd79f8ca38b0a6a453617758663.tar.gz ravanan-dd5bbcfa9accdfd79f8ca38b0a6a453617758663.tar.lz ravanan-dd5bbcfa9accdfd79f8ca38b0a6a453617758663.zip | |
work/command-line-tool: Construct command-line bindings recursively.
This is required for command-line bindings that have array values.
| -rw-r--r-- | ravanan/work/command-line-tool.scm | 31 |
1 files 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{<command-line-binding>} 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 |
