I'm looking at automatically generating some CWL, and I'm trying to work out if the arguments
of a CommandLineTool will always be contiguous, i.e. if you have a file like this:
cwlVersion: v1.0
class: CommandLineTool
baseCommand: echo
inputs:
- id: foo
type: string
inputBinding:
position: 0
- id: bar
type: string
inputBinding:
position: 0
- id: a
type: string
inputBinding:
position: -1
outputs: []
arguments:
- arg1
- arg2
whether arg1
and arg2
will always be immediately adjacent to each other, whether or not there are arguments to either side of them.
As far as I can tell, this is indeed the case – in this example, the command line generated by cwltool is echo a arg1 arg2 bar foo
, but I can't work out from the CWL spec whether this is guaranteed behaviour. Will all spec-compliant CWL runners generate a command line for this example with arg1
and arg2
adjacent?
-1 put a at the front?
I think it did, yes.
Okay, that sounds weird to me since -1 implies the last element in a list (and the command line is a list of arguments/inputs). Either way see below, by forcing the position using
inputBinding: position
you guarantee their order.