Skip to content

Commit 6ecaecd

Browse files
committed
more info on glob and examples
1 parent d6e5142 commit 6ecaecd

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/faq.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,13 @@ those Docker format containers using the Singularity engine. Directly
448448
specifying a Singularity format container is not part of the CWL standards.
449449

450450
## How outputBinding.glob works
451-
The `outputBinding` section describes how to set the value of each output parameter. The `glob` field is used to return all files/pathnames that match a specific pattern. The value of the glob field is the `output directory`.
451+
The `outputBinding` section describes how to set the value of each output parameter. The `glob` field is used to return all files/pathnames that match a specific pattern. The `glob` field specifies the file and the output directory in which the file should be stored. The value of the glob field is the `output directory`.
452+
If the value of glob is a relative path pattern (one that does not start with a slash '/'), it is resolved relative to the output directory. If the glob value is an absolute path pattern (it starts with a slash '/'), it must refer to a path within the output directory.
452453
Glob's pattern rules abide to standard Unix path expansion rules. According to benchmarks, it is also expected to be faster than other methods for matching pathnames in directories.
453454
Wildcard characters can be used in the filenames when searching for files. The wildcard characters can either be an asterisk `*`, a question mark matching pathnames in directories. `?` or a range `[]`
454455

456+
In the example below, the glob field is used to specify the file(`hello.txt`) in which the output should be stored.
457+
455458
```cwl
456459
outputs:
457460
example_out:
@@ -470,6 +473,24 @@ outputs:
470473
glob: '*.txt'
471474
```
472475

476+
Glob can also be used to return all outputs from a CommandLine Tool. For example
477+
478+
```
479+
outputs:
480+
type: Directory
481+
outputBinding: { glob: . }
482+
```
483+
484+
OR
485+
486+
```
487+
outputs:
488+
type:
489+
type: array
490+
items: [Directory, File]
491+
outputBinding: {glob: "*"}
492+
```
493+
473494
## Debug JavaScript Expressions
474495
475496
You can use the <code>--js-console</code> option of <code>cwltool</code>, or you can try

0 commit comments

Comments
 (0)