aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-09-28 22:48:09 +0100
committerArun Isaac2023-09-28 22:48:09 +0100
commit8319713ba08ae0127d5018143012c0e6a4211cb3 (patch)
treecd6742b79cc4f7fbfef24ecdfb98e33b188f71ea
parent03376c2c7c23b538d6b3e90b8c6d8534e367ab7a (diff)
downloadccwl-8319713ba08ae0127d5018143012c0e6a4211cb3.tar.gz
ccwl-8319713ba08ae0127d5018143012c0e6a4211cb3.tar.lz
ccwl-8319713ba08ae0127d5018143012c0e6a4211cb3.zip
cwl: Add command to CWL serialization function.
* ccwl/cwl.scm (command->cwl): New public function.
-rw-r--r--ccwl/cwl.scm11
1 files 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 <arunisaac@systemreboot.net>
+;;; Copyright © 2021, 2023 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; 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{<command>} object, to @var{port} as a
+CWL YAML specification."
+ (scm->yaml (command->cwl-scm command)
+ port))
+
(define (command->cwl-scm command)
"Render COMMAND, a <command> object, into a CWL tree."
`((cwlVersion . ,%cwl-version)