common-workflow-language
common-workflow-language copied to clipboard
CommandInputRecordField needs `default` field
cwltool
behaves the default value of optional boolean parameters as false
(I am not sure it is described in the spec) but sometimes we want to set true
as default for several parameters.
We can use default
field for the usual parameters but it is not provided for CommandInputRecordField
.
Is there a way to set the default value for exclusive parameters or am I missing something?
Here is a simple example (wc.cwl
) to show what I want.
It supports the following exclusive options:
-
help
: a parameter to show the help message -
version
: a parameter to show the version -
bytes
,chars
,lines
andinput
: parameters for usual case
How to write to set the default value of bytes
true
?
cwlVersion: v1.0
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: ubuntu
baseCommand: wc
inputs:
mode:
type:
- type: record
name: help-mode
fields:
help:
type: boolean
inputBinding:
prefix: --help
- type: record
name: version-mode
fields:
version:
type: boolean
inputBinding:
prefix: --version
- type: record
name: main-mode
fields:
bytes:
type: boolean?
inputBinding:
prefix: -c
chars:
type: boolean?
inputBinding:
prefix: -m
lines:
type: boolean?
inputBinding:
prefix: -l
input:
type: File
inputBinding: {}
outputs: []
Note: #428 is a similar but different issue. #428 is for the default value of record type but this issue is about the default value of specific fields in record object.
This issue has been mentioned on Common Workflow Language Discourse. There might be relevant details there:
https://cwl.discourse.group/t/creating-config-json-file-from-a-record/172/3