Skip to content

Commit b9bed11

Browse files
author
Peter Amstutz
committed
Merge branch 'shell-commands'
2 parents 411e81a + 4eecd07 commit b9bed11

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

draft-3/cwl-avro.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,12 @@
11431143
11441144
When a binding is part of the `CommandLineTool.arguments` field,
11451145
the `valueFrom` field is required.
1146-
1146+
- name: shellQuote
1147+
type: ["null", boolean]
1148+
doc: |
1149+
If `ShellCommandRequirement` is in the requirements for the current command,
1150+
this controls whether the value is quoted on the command line (default is true).
1151+
Use `shellQuote: false` to inject metacharacters for operations such as pipes.
11471152
11481153
- type: record
11491154
name: CommandOutputBinding
@@ -2044,3 +2049,15 @@
20442049
the expression engine. The semantics of this field are defined by the
20452050
underlying expression engine. Intended for uses such as providing
20462051
function definitions that will be called from CWL expressions.
2052+
2053+
- type: record
2054+
name: ShellCommandRequirement
2055+
extends: "#ProcessRequirement"
2056+
doc: |
2057+
Modify the behavior of CommandLineTool to generate a single string
2058+
containing a shell command line. Each item in the argument list must be
2059+
joined into a string separated by single spaces and quoted to prevent
2060+
intepretation by the shell, unless `CommandLineBinding` for that argument
2061+
contains `shellQuote: false`. If `shellQuote: false` is specified, the
2062+
argument is joined into the command string without quoting, which allows
2063+
the use of shell metacharacters such as `|` for pipes.

draft-3/draft-3/shelltest.cwl

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
class: CommandLineTool
2+
description: "Reverse each line using the `rev` command then sort."
3+
requirements:
4+
- class: ShellCommandRequirement
5+
inputs:
6+
- id: "#input"
7+
type: File
8+
outputs:
9+
- id: "#output"
10+
type: File
11+
outputBinding:
12+
glob: output.txt
13+
14+
baseCommand: []
15+
arguments:
16+
- rev
17+
- valueFrom:
18+
engine: cwl:JsonPointer
19+
script: /job/input
20+
- valueFrom: " | "
21+
shellQuote: false
22+
- sort
23+
- valueFrom: "> output.txt"
24+
shellQuote: false

0 commit comments

Comments
 (0)