Skip to content

Commit a8d8d00

Browse files
author
Peter Amstutz
authored
Cwltool options (#1205)
* Add CWLTOOL_OPTIONS
1 parent 0184e64 commit a8d8d00

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

README.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Common Workflow Language tool description reference implementation
44

55
CWL conformance tests: |Conformance Status| |Linux Status| |Windows Status| |Coverage Status| |Downloads|
66

7-
|CommandLineTool Support| |DockerRequirement Support| |EnvVarRequirement Support| |ExpressionTool Support|
7+
|CommandLineTool Support| |DockerRequirement Support| |EnvVarRequirement Support| |ExpressionTool Support|
88
|InitialWorkDirRequirement Support| |InlineJavascriptRequirement Support| |MultipleInputRequirement Support| |Core Support|
99
|ResourceRequirement Support| |ScatterRequirement Support| |SchemaDefRequirement Support| |ShellCommandequirement Support|
1010
|StepInputRequirement Support| |SubWorkflowRequirement Support| |Workflow Support|
@@ -145,6 +145,11 @@ the default cwl-runner use::
145145

146146
cwltool [tool-or-workflow-description] [input-job-settings]
147147

148+
You can set cwltool options in the environment with CWLTOOL_OPTIONS,
149+
these will be inserted at the beginning of the command line::
150+
151+
export CWLTOOL_OPTIONS="--debug"
152+
148153
Use with boot2docker
149154
--------------------
150155
boot2docker runs Docker inside a virtual machine and it only mounts ``Users``

cwltool/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,10 @@ def main(argsl=None, # type: Optional[List[str]]
517517
if args is None:
518518
if argsl is None:
519519
argsl = sys.argv[1:]
520-
args = arg_parser().parse_args(argsl)
520+
addl = [] # type: List[str]
521+
if "CWLTOOL_OPTIONS" in os.environ:
522+
addl = os.environ["CWLTOOL_OPTIONS"].split(" ")
523+
args = arg_parser().parse_args(addl+argsl)
521524
if args.record_container_id:
522525
if not args.cidfile_dir:
523526
args.cidfile_dir = os.getcwd()

test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pytest-mock >= 1.10.0
44
pytest-cov
55
arcp >= 0.2.0
66
rdflib-jsonld >= 0.4.0
7+
attrs <19.2.0

tests/test_ext.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ def test_listing_deep():
2727
get_data('tests/listing-job.yml')]
2828
assert main(params) == 0
2929

30+
@needs_docker
31+
def test_cwltool_options():
32+
os.environ["CWLTOOL_OPTIONS"] = "--enable-ext"
33+
params = [get_data('tests/wf/listing_deep.cwl'),
34+
get_data('tests/listing-job.yml')]
35+
assert main(params) == 0
36+
del os.environ["CWLTOOL_OPTIONS"]
37+
3038
@needs_docker
3139
def test_listing_shallow():
3240
# This fails on purpose, because it tries to access listing in a subdirectory

0 commit comments

Comments
 (0)