From 8319713ba08ae0127d5018143012c0e6a4211cb3 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 28 Sep 2023 22:48:09 +0100 Subject: cwl: Add command to CWL serialization function. * ccwl/cwl.scm (command->cwl): New public function. --- ccwl/cwl.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ccwl/cwl.scm b/ccwl/cwl.scm index e4d03bc..30ec6ec 100644 --- a/ccwl/cwl.scm +++ b/ccwl/cwl.scm @@ -1,5 +1,5 @@ ;;; ccwl --- Concise Common Workflow Language -;;; Copyright © 2021 Arun Isaac +;;; Copyright © 2021, 2023 Arun Isaac ;;; ;;; This file is part of ccwl. ;;; @@ -28,7 +28,8 @@ #:use-module (ccwl ccwl) #:use-module (ccwl utils) #:use-module (ccwl yaml) - #:export (workflow->cwl)) + #:export (workflow->cwl + command->cwl)) (define %cwl-version "v1.2") @@ -101,6 +102,12 @@ association list." (cons 'outputBinding (output-binding output))))) ,@(output-other output))) +(define (command->cwl command port) + "Render @var{command}, a @code{} object, to @var{port} as a +CWL YAML specification." + (scm->yaml (command->cwl-scm command) + port)) + (define (command->cwl-scm command) "Render COMMAND, a object, into a CWL tree." `((cwlVersion . ,%cwl-version) -- cgit v1.2.3