Skip to content

Commit 6fc30e1

Browse files
authored
Merge pull request #300 from common-workflow-language/stdin-shortcut
stdin shortcut
2 parents 1c05584 + 0c148fe commit 6fc30e1

File tree

5 files changed

+43
-16
lines changed

5 files changed

+43
-16
lines changed

doc/add-new-draft.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ How to make a new draft version of the CWL spec
1111

1212
4. In the reference implementation (cwltool): make a new branch, and update the
1313
subtree checkout of the spec:
14-
15-
git subtree merge -P cwltool/schemas/ cwl_repo/v1.1.0-dev1
14+
15+
git subtree merge --squash -P cwltool/schemas/ cwl_repo/v1.1.0-dev1
1616

1717
Where `cwl_repo` is the remote repository for the CWL specifications.
1818
4. In the reference implementation, teach it about the new draft version:

run_test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ JUNIT_XML=""
1717
RUNNER=cwl-runner
1818
PLATFORM=$(uname -s)
1919
COVERAGE="python"
20+
EXTRA=""
2021

2122
while [[ -n "$1" ]]
2223
do
@@ -70,7 +71,7 @@ runtest() {
7071
(cd $DRAFT
7172
cwltest --tool "$1" \
7273
--test=conformance_test_${DRAFT}.yaml ${TEST_N} \
73-
${TEST_L} ${ONLY_TOOLS} ${JUNIT_XML} --basedir ${DRAFT}
74+
${TEST_L} ${ONLY_TOOLS} ${JUNIT_XML} --basedir ${DRAFT} -- ${EXTRA}
7475
)
7576
checkexit
7677
}

v1.1.0-dev1/CommandLineTool.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ $graph:
4242
maintenance release of the CWL CommandLineTool specification.
4343
Version 1.1 introduces the followings additions:
4444
45-
*
45+
* Addition of `stdin` type shortcut for `CommandInputParamater`s.
4646
4747
## Introduction to v1.0
4848
@@ -388,6 +388,7 @@ $graph:
388388
type:
389389
- "null"
390390
- CWLType
391+
- stdin
391392
- stdout
392393
- stderr
393394
- CommandOutputRecordSchema
@@ -409,6 +410,31 @@ $graph:
409410
doc: |
410411
Specify valid types of data that may be assigned to this parameter.
411412
413+
- name: stdin
414+
type: enum
415+
symbols: [ "cwl:stdin" ]
416+
docParent: "#CommandOutputParameter"
417+
doc: |
418+
Only valid as a `type` for a `CommandLineTool` input with no
419+
`inputBinding` set. `stdin` must not be specified at the `CommandLineTool`
420+
level.
421+
422+
The following
423+
```
424+
inputs:
425+
an_input_name:
426+
type: stdin
427+
```
428+
is equivalent to
429+
```
430+
inputs:
431+
an_input_name:
432+
type: File
433+
streamable: true
434+
435+
stdin: ${inputs.an_input_name.path}
436+
```
437+
412438
- name: stdout
413439
type: enum
414440
symbols: [ "cwl:stdout" ]
@@ -558,6 +584,7 @@ $graph:
558584
"_container": "@list"
559585
- name: stdin
560586
type: ["null", string, Expression]
587+
jsonldPredicate: "https://w3id.org/cwl/cwl#stdin"
561588
doc: |
562589
A path to a file whose contents must be piped into the command's
563590
standard input stream.

v1.1.0-dev1/conformance_test_v1.1.0-dev1.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@
117117
tool: v1.1.0-dev1/cat4-tool.cwl
118118
doc: Test command execution in Docker with stdin and stdout redirection
119119

120+
- job: v1.1.0-dev1/cat-job.json
121+
output:
122+
output_txt:
123+
class: File
124+
checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b
125+
location: output.txt
126+
size: 13
127+
tool: v1.1.0-dev1/cat4b-tool.cwl
128+
doc: Test command execution in Docker with stdin and stdout redirection
129+
with stdin shortcut
130+
120131
- job: v1.1.0-dev1/empty.json
121132
tool: v1.1.0-dev1/null-expression1-tool.cwl
122133
output:

v1.1.0-dev1/v1.1.0-dev1/cat2-tool.cwl

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)