summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-09-28 23:46:59 +0100
committerArun Isaac2023-09-28 23:46:59 +0100
commita9039b5d116e10b8cb2213a276b071a234366842 (patch)
treea000699a77efd812876b1cdf93df101e40f715b7
parent9dbb8a48d838ec1fc51c4770cb25741d4a173081 (diff)
downloadccwl-a9039b5d116e10b8cb2213a276b071a234366842.tar.gz
ccwl-a9039b5d116e10b8cb2213a276b071a234366842.tar.lz
ccwl-a9039b5d116e10b8cb2213a276b071a234366842.zip
graphviz: Add generic workflow or command serialization function.
* ccwl/cwl.scm (workflow-or-command->dot): New public function.
-rw-r--r--ccwl/graphviz.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/ccwl/graphviz.scm b/ccwl/graphviz.scm
index 2dc4f8d..820aadc 100644
--- a/ccwl/graphviz.scm
+++ b/ccwl/graphviz.scm
@@ -33,7 +33,15 @@
#:use-module (ccwl ccwl)
#:use-module (ccwl utils)
#:export (workflow->dot
- command->dot))
+ command->dot
+ workflow-or-command->dot))
+
+(define workflow-or-command->dot
+ (match-lambda*
+ (((? workflow? workflow) port)
+ (workflow->dot workflow port))
+ (((? command? command) port)
+ (command->dot command port))))
(define (workflow->dot workflow port)
"Render WORKFLOW, a <workflow> object, to PORT in the graphviz dot