diff options
| author | Arun Isaac | 2025-12-17 22:19:23 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-12-17 22:26:38 +0000 |
| commit | 43d66ffa64933ec1a6e521355423c0cc9f5442e0 (patch) | |
| tree | 75ebc05b161acec1f66c1060a36e99cec671cf68 | |
| parent | 3d1f953004cec200e2e6b55941c15e14d3494323 (diff) | |
| download | ravanan-43d66ffa64933ec1a6e521355423c0cc9f5442e0.tar.gz ravanan-43d66ffa64933ec1a6e521355423c0cc9f5442e0.tar.lz ravanan-43d66ffa64933ec1a6e521355423c0cc9f5442e0.zip | |
work/command-line-tool: Do not assume valueFrom evaluate to strings.
valueFrom can have expressions that evaluate to numbers, booleans, arrays, or indeed any other type.
| -rw-r--r-- | ravanan/work/command-line-tool.scm | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/ravanan/work/command-line-tool.scm b/ravanan/work/command-line-tool.scm index b64fcad..488aba2 100644 --- a/ravanan/work/command-line-tool.scm +++ b/ravanan/work/command-line-tool.scm @@ -38,7 +38,6 @@ unsupported-uri-scheme? unsupported-uri-scheme-scheme - value->string call-with-current-directory object-type match-type @@ -67,12 +66,6 @@ unsupported-uri-scheme unsupported-uri-scheme? (scheme unsupported-uri-scheme-scheme)) -(define (value->string x) - "Convert value @var{x} to a string." - (cond - ((number? x) (number->string x)) - (else x))) - (define (call-with-current-directory curdir thunk) "Call THUNK with current directory set to CURDIR. Restore current directory after THUNK returns." @@ -359,14 +352,15 @@ the G-expressions are inserted." 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 (argument->command-line-binding i argument) - (command-line-binding (cond - ((assoc-ref argument "position") - => string->number) - (else i)) - (maybe-assoc-ref (just argument) "prefix") - 'string - (value->string (assoc-ref* argument "valueFrom")) - %nothing)) + (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))) (define (collect-bindings ids+inputs+types+bindings) (append-map id+input+type-tree+binding->command-line-binding |
