Skip to content

Commit c047876

Browse files
committed
Adding more text for exclusive vs inclusive parameters and added diagram
1 parent dd897f4 commit c047876

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed
Loading

src/topics/inputs.md

+18-8
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,21 @@ You can specify arrays of arrays, arrays of records, and other complex types.
190190

191191
## Inclusive and Exclusive Inputs
192192

193-
Sometimes an underlying tool has several arguments that must be provided
194-
together (they are dependent) or several arguments that cannot be provided
195-
together (they are exclusive). You can use records and type unions to group
193+
Sometimes an underlying tool has several arguments that must all be provided
194+
together (they are inclusive/dependent) or several arguments that cannot be provided
195+
together, only one of the arguments can be provided (they are exclusive). You can use records and type unions to group
196196
parameters together to describe these two conditions.
197197

198+
```{image} /_static/images/diagrams/inclusive_v_exclusive.png
199+
:name: inclusive_v_exclusive-diagram
200+
:width: 600px
201+
:align: center
202+
```
203+
204+
205+
With cwltool, if not all inclusive arguments are provided, an error is thrown.
206+
If multiple exclusive arguments are provided, the first one is used and the rest are ignored.
207+
198208
```{literalinclude} /_includes/cwl/inputs/record.cwl
199209
:language: cwl
200210
:caption: "`record.cwl`"
@@ -212,7 +222,7 @@ parameters together to describe these two conditions.
212222
:emphasize-lines: 6-7
213223
```
214224

215-
In the first example, you can't provide `itemA` without also providing `itemB`.
225+
In the first example, you can't provide `itemA` without also providing `itemB`, or an error is thrown. This is because they are inclusive (dependent) parameters. If you provide one, you must provide the other.
216226

217227
```{literalinclude} /_includes/cwl/inputs/record-job2.yml
218228
:language: yaml
@@ -230,8 +240,8 @@ $ cat output.txt
230240
-A one -B two -C three
231241
```
232242

233-
In the second example, `itemC` and `itemD` are exclusive, so only the first
234-
matching item (`itemC`) is added to the command line and remaining item (`itemD`) is ignored.
243+
In the second example, `itemC` and `itemD` are exclusive, but `record-job2.yml` provides both arguments, so only the first
244+
matching item provided (`itemC`) is added to the command line and remaining item (`itemD`) is ignored.
235245

236246
```{literalinclude} /_includes/cwl/inputs/record-job3.yml
237247
:language: yaml
@@ -249,8 +259,8 @@ $ cat output.txt
249259
-A one -B two -D four
250260
```
251261

252-
In the third example, only `itemD` is provided, so it appears on the
253-
command line.
262+
In the third example, `record-job3.yml` only provides `itemD`, so `itemD` is what appears on the
263+
command line.
254264

255265
### Exclusive Input Parameters with Expressions
256266

0 commit comments

Comments
 (0)