Array with different flags

Hi everyone,
i have to write a step that have in input an array of file and for each file i need a different prefix. e.g.
bowtie2 -1 *path_file_1* -2 *path_file_2* *other flags*

Are there an elegant way of do it? I found only discussions on array with same prefix. For now i wrote this

baseCommand: [ "bowtie2" ]
  - position: 1
    prefix: "-1"
    valueFrom: $(inputs.samples[0])
  - position: 2
    prefix: "-2"
    valueFrom: $(inputs.samples[1])

  samples: File[]

This is basically the same thing, but more compact:

arguments: ["-1", "$(inputs.samples[0])", "-2", "$(inputs.samples[1])"]

Does the array only ever have two entries? Then I’d recommend two separate inputs instead of an array. Perhaps the second input is optional

The array can have one or two elements and the flags are differents.
When there are two elements the flags are “-1” and “-2”, instead when it only one the flag is “-U”. I think that the usage of inputBinding and prefix is very elegant when the prefix is repeated. I wanted to know if it can do a similar thing but with different prefixes, but I guess not.

Thanks anyway for the replies

Perhaps this bowtie2 description in the community repository is sufficient for your needs:

It appears to handle the -U vs -1 & -2 situation.