Skip to content

Commit 597e0d9

Browse files
committed
more info on glob and examples
1 parent 2b3669f commit 597e0d9

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
@@ -447,10 +447,13 @@ those Docker format containers using the Singularity engine. Directly
447447
specifying a Singularity format container is not part of the CWL standards.
448448

449449
## How outputBinding.glob works
450-
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`.
450+
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`.
451+
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.
451452
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.
452453
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 `[]`
453454

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

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

0 commit comments

Comments
 (0)