Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommandInputRecordField needs default field #641

Open
tom-tan opened this issue Mar 6, 2018 · 2 comments · May be fixed by common-workflow-language/cwl-v1.3#54
Open

CommandInputRecordField needs default field #641

tom-tan opened this issue Mar 6, 2018 · 2 comments · May be fixed by common-workflow-language/cwl-v1.3#54
Milestone

Comments

@tom-tan
Copy link
Member

tom-tan commented Mar 6, 2018

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.

@cwl-bot
Copy link

cwl-bot commented Jul 30, 2020

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

@mr-c mr-c modified the milestones: post v1.2, cwlnext Sep 11, 2020
@mr-c
Copy link
Member

mr-c commented Jul 8, 2024

I still think this is a good idea, yes; Please move common-workflow-language/cwl-v1.1#20 over to https://github.com/common-workflow-language/cwl-v1.3 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants