scipipe icon indicating copy to clipboard operation
scipipe copied to clipboard

Allow specifying output path formats inline in the command pattern

Open samuell opened this issue 4 years ago • 0 comments

Right now, to define a process with an output path pattern, one has to do this in two steps:

proc := wf.NewProc("proc", "echo hi > {o:hi}")
proc.SetOut("hi", "hi.txt")

This could be shortened if allowing to set the path formatter inline in the command pattern, like so:

proc := wf.NewProc("proc", "echo hi > {o:hi:hi.txt}")

Similarly, if one process takes an input, one can still do a dynamic pattern inline too. So this:

p1 := wf.NewProc("proc", "echo hi > {o:hi}")
p1.SetOut("hi", "hi.txt")

p2 := wf.NewProc("p2", "cat {i:in} | tr h H > {o:out}")
p2.SetOut("out", "{i:in}.out.txt")
p2.In("in").From(p1.Out("hi"))

... would become this:

p1 := wf.NewProc("p1", "echo hi > {o:hi:hi.txt}")

p2 := wf.NewProc("p2", "cat {i:in} | tr h H > {o:out:{i:in}.out.txt"}
p2.In("in").From(p1.Out("hi"))

samuell avatar Apr 08 '21 17:04 samuell