How to pass parameters to a flag accepting multiple values

27 views
Skip to first unread message

Jerry

unread,
Jul 12, 2017, 9:31:29 PM7/12/17
to bpipe-discuss
How to pass parameters to a flag accepting multiple values, e.g.,

--m file_one --m file_two --m file_three

In addition, the number of input files is not known beforehand.

It seems that: bpipe run -p m=file_one -p m=file_two ... does not work for this case. Thank you.

Simon

unread,
Jul 13, 2017, 10:25:41 PM7/13/17
to bpipe-discuss
Hi Jiarui,
Usually you would pass input files by adding them to your bpipe command, so

  bpipe run pipeline.groovy  file_one file_two ....

These can then be resolved inside the pipeline using the $input variable ($inputs to get them all, $input1 for the first, etc), or you can use a split pattern to parallelise over the files, see:


If it's not really an input file but some other configuration type file then passing it as a parameter makes sense. For that case I'd recommend a comma separated list:

  bpipe run -p m=file_one,file_two,...  

Inside the pipeline script you can parse this:

  m_values = m.tokenize(",")

Hope this helps!

Simon




Reply all
Reply to author
Forward
0 new messages