This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to pass exclusive parameters on the command line (cwl-runner)

I am trying to run a tool definition on the command line without a job document. It is unclear to me how to pass exclusive parameters,

cwl-runner Tools/ls.tool.yaml --mydir Data/Inputs/ --myfile Tools/ls.tool.yaml --bySize

/usr/local/bin/cwl-runner 1.0.20170329142446
Resolved 'Tools/ls.tool.yaml' to 'file:///pipeline/CWL/Tools/ls.tool.yaml'
usage: Tools/ls.tool.yaml [-h] --mydir MYDIR --myfile MYFILE [job_order]
Tools/ls.tool.yaml: error: unrecognized arguments: --bySize

Tool definition:

cwlVersion: v1.0
class: CommandLineTool
baseCommand: [ls , .]


requirements:
  - class: InlineJavascriptRequirement
  - class: InitialWorkDirRequirement
    listing: |
      ${
        var listing = inputs.mydir.listing;
        listing.push(inputs.myfile);
        return listing;
       }

stdout: ls.log
stderr: error.log

inputs:
  mydir:
    type: Directory
  myfile:
    type: File
  exclusive_parameters:
    type:
      - type: record
        name: listingByTime
        fields:
          long_listing:
            type: boolean
            inputBinding:
              prefix: -ltr
      - type: record
        name: size
        fields:
          bySize:
            type: boolean
            inputBinding:
              prefix: -S  


outputs:
  output:
    type: stdout
  error: 
    type: stderr
cwl

1 answer

Thank you awilke1972 for your question.

The ability of the CWL reference implementation (cwltool / cwlref-runner) to accept inputs on the command line is currently experimental.

While is very useful, it does not currently support mutually exclusive input parameter specification -- you'll need to use a stand alone input document in these instances

I've created an issue on Github to remind us to fix this later https://github.com/common-workflow-language/cwltool/issues/358

Log in to answer this question.