summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ccwl/cwl.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/ccwl/cwl.scm b/ccwl/cwl.scm
index 30ec6ec..4c4fef0 100644
--- a/ccwl/cwl.scm
+++ b/ccwl/cwl.scm
@@ -29,10 +29,18 @@
   #:use-module (ccwl utils)
   #:use-module (ccwl yaml)
   #:export (workflow->cwl
-            command->cwl))
+            command->cwl
+            workflow-or-command->cwl))
 
 (define %cwl-version "v1.2")
 
+(define workflow-or-command->cwl
+  (match-lambda*
+    (((? workflow? workflow) port)
+     (workflow->cwl workflow port))
+    (((? command? command) port)
+     (command->cwl command port))))
+
 (define (workflow->cwl workflow port)
   "Render WORKFLOW, a <workflow> object, to PORT as a CWL YAML
 specification."