common-workflow-language / common-workflow-language/cwltool
munge spaces when generating CLI interface
- Dominant language
- Python
- Stars
- 376
- Forks
- 255
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Description
## Expected Behavior
Validation shouldn't be passed
## Actual Behavior
Validation is passed
## Workflow Code
```
cwlVersion: v1.0
class: CommandLineTool
baseCommand: [echo]
inputs:
some string:
type: string
inputBinding:
position: 1
outputs: []
```
Tool usage looks like this and it says that `--some string` is an argument name
```
usage: test.cwl [-h] --some string SOME STRING [job_order]
test.cwl: error: argument --some string is required
```
But of course this doesn't work this way:
```
cwltool test.cwl --some string abcdef
------
[Errno 2] No such file or directory: '/mnt/projects/ASIL/pipelines/torrent-cwl-pipeline/abcdef'
```
But surprisingly works this way:
```
cwltool test.cwl --some string
--------
[job test.cwl] /tmp/tmpzbyAR6$ echo \
string
string
[job test.cwl] completed success
{}
Final process status is success
```
**Maybe some general constraints on id's value, are needed. Now its value is just a` string` as in doc or format, however there spaces are possible, and in id I think it's reasonable to avoid them**
## Your Environment
* cwltool version: 1.0.20170803160545
Contributor guide
Research direction
Start by reproducing the issue with the provided CommandLineTool workflow and inspect how its input IDs become CLI arguments. Verify the generated usage and invocation behavior for the `some string` input. Done means spaces in the input ID no longer produce the shown argument ambiguity or incorrect validation behavior.
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
- 35/100