Nextflow: Error when parsing params starting with - or -- in quote

Created on 15 Jul 2020  Â·  3Comments  Â·  Source: nextflow-io/nextflow

Bug report

When submitting a params starting with - or -- with quotes, Nextflow thinks it's a Nextflow option, or register it as true respectively.

Expected behavior and actual behavior

Actual:

≻ nextflow run MaxUlysse/nextflow_params_opt --opt "-foo" 
Unknown option: -foo -- Check the available commands and options and syntax with 'help'

≻ nextflow run MaxUlysse/nextflow_params_opt --opt "--foo"
N E X T F L O W  ~  version 20.05.0-edge
Launching `MaxUlysse/nextflow_params_opt` [reverent_bartik] - revision: 5aa15fb9f0 [master]
executor >  local (1)
[37/01f0a2] process > test [100%] 1 of 1 ✔
true

Expected:

≻ nextflow run MaxUlysse/nextflow_params_opt --opt "-foo"
N E X T F L O W  ~  version 20.05.0-edge
Launching `MaxUlysse/nextflow_params_opt` [reverent_bartik] - revision: 5aa15fb9f0 [master]
executor >  local (1)
[37/01f0a2] process > test [100%] 1 of 1 ✔
-foo

≻ nextflow run MaxUlysse/nextflow_params_opt --opt "--foo"
N E X T F L O W  ~  version 20.05.0-edge
Launching `MaxUlysse/nextflow_params_opt` [reverent_bartik] - revision: 5aa15fb9f0 [master]
executor >  local (1)
[37/01f0a2] process > test [100%] 1 of 1 ✔
--foo

Managed to have the expected behaviour using an =:

≻ nextflow run MaxUlysse/nextflow_params_opt --opt="-foo" 
N E X T F L O W  ~  version 20.05.0-edge
Launching `MaxUlysse/nextflow_params_opt` [deadly_chandrasekhar] - revision: 5aa15fb9f0 [master]
executor >  local (1)
[ce/d776c8] process > test [100%] 1 of 1 ✔
-foo

≻ nextflow run MaxUlysse/nextflow_params_opt --opt="--foo"
N E X T F L O W  ~  version 20.05.0-edge
Launching `MaxUlysse/nextflow_params_opt` [disturbed_mandelbrot] - revision: 5aa15fb9f0 [master]
executor >  local (1)
[c3/20ee15] process > test [100%] 1 of 1 ✔
--foo

Steps to reproduce the problem

nextflow run MaxUlysse/nextflow_params_opt --opt "-foo"
nextflow run MaxUlysse/nextflow_params_opt --opt "--foo"

Program output

(Copy and paste here output produced by the failing execution. Please highlight it as a code block. Whenever possible upload the .nextflow.log file.)

Environment

  • Nextflow version: [20.05.0-edge]
  • Java version: [?]
  • Operating system: [Linux Mint]
  • Bash version: (use the command zsh 5.4.2 (x86_64-ubuntu-linux-gnu))

Additional context

(Add any other context about the problem here)

Most helpful comment

I fear this is a .. feature! 😱

All 3 comments

reproduced on GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)

I fear this is a .. feature! 😱

The " does nothing here, the quotes are not even passed to the NF runtime.

Screenshot 2020-07-16 at 18 14 24

The logic behind is that an option is followed by a -string, this sequence is interpreted as the following cli params, and the prevision as a boolean params flag implicitly true.

Cannot do anything, other than rewriting the CLI interpreter #556.

Was this page helpful?
0 / 5 - 0 ratings