common-workflow-language / common-workflow-language/cwltool

command line input specification using custom enum not working unless they are arrays

Open
#573 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

When a custom type is defined elsewhere and it is used on a CommandLineTool, the custom type has to be used as an **array**. Otherwise, cwltool can't make a command line argument from it.

## Expected Behavior
```
$cwltool https://raw.githubusercontent.com/esanzgar/webservice-cwl/master/docker_cwls/custom-types.cwl --help

usage: https://raw.githubusercontent.com/esanzgar/webservice-cwl/master/docker_cwls/custom-types.cwl
[-h] [job_order]

positional arguments:
job_order Job input json file

optional arguments:
-h, --help show this help message and exit
**--applications APPLICATIONS**
```

## Actual Behavior
`--application` option is not present:

```
$cwltool https://raw.githubusercontent.com/esanzgar/webservice-cwl/master/docker_cwls/custom-types.cwl --help

usage: https://raw.githubusercontent.com/esanzgar/webservice-cwl/master/docker_cwls/custom-types.cwl
[-h] [job_order]

positional arguments:
job_order Job input json file

optional arguments:
-h, --help show this help message and exit
```

## Workflow Code
https://raw.githubusercontent.com/esanzgar/webservice-cwl/master/docker_cwls/custom-types.cwl

## Debug
```
cwltool --debug https://raw.githubusercontent.com/esanzgar/webservice-cwl/master/docker_cwls/custom-types.cwl --help

**Can't make command line argument from https://raw.githubusercontent.com/esanzgar/webservice-cwl/master/docker_cwls/MyTypes.yaml#opt**

usage: https://raw.githubusercontent.com/esanzgar/webservice-cwl/master/docker_cwls/custom-types.cwl
[-h] [job_order]

positional arguments:
job_order Job input json file

optional arguments:
-h, --help show this help message and exit
```

## Your Environment
* cwltool version: 1.0.20170928192020

Contributor guide

Open the contributing guide

Research direction

Start by running the reported cwltool command against custom-types.cwl and inspect the handling of MyTypes.yaml#opt when constructing command-line arguments. Compare the non-array custom enum with the array case. Done means the non-array custom type produces the expected --applications option and the existing debug message no longer appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.