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

Shell command requirement #329

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Fienne
Copy link
Contributor

@Fienne Fienne commented Oct 21, 2022

fixes #159

@Fienne
Copy link
Contributor Author

Fienne commented Oct 21, 2022

I forgot to merge my branches locally and the commit from my previous branch got into this one. Please let me know if I should delete the branch and re-commit or not.

@@ -446,6 +446,16 @@ The reference runner and several other CWL implementations support running
those Docker format containers using the Singularity engine. Directly
specifying a Singularity format container is not part of the CWL standards.

## Shell Command Requirement
`ShellCommandRequirement` in CWL is used to convert a list of arguments into a string containing a shell command line.
Each item in the argument list must be joined into a string separated by single spaces and quoted to prevent intepretation by the shell, unless `CommandLineBinding` for that argument contains `shellQuote: false`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to copy text from the specification, you have to at least reword it so it is speaking to the right audience.

The specification is speaking to people who are writing code to run CWL. So when it says "it must do something" it is saying their CWL runner must do this.

For the audience of CWL users, you want to say what will happen. So this needs to be change to say "...each item will be joined..."

If `shellQuote: false` is specified, the argument is joined into the command string without quoting, which allows the use of shell metacharacters such as `|` for pipes.
`ShellCommandRequirement` in CWL allows us to use `/bin/sh -c` in order to pass our command as a string to a shell intrepreter. `ShellQuote:false` leaves shell metacharacters unquoted, and thus they can still be interpreted and used by a shell.

To use the `ShellCommandRequirement`, you need to pass in the class name `ShellCommandRequirement` as a string.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs example.

`ShellCommandRequirement` in CWL is used to convert a list of arguments into a string containing a shell command line.
Each item in the argument list must be joined into a string separated by single spaces and quoted to prevent intepretation by the shell, unless `CommandLineBinding` for that argument contains `shellQuote: false`.

If `shellQuote: false` is specified, the argument is joined into the command string without quoting, which allows the use of shell metacharacters such as `|` for pipes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs example.

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 this pull request may close these issues.

Explain ShellCommandRequirement
2 participants