Skip to content

CommandInputRecordField needs default fieldΒ #641

Open
common-workflow-language/cwl-v1.3
#54
@tom-tan

Description

@tom-tan

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 and input: 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions