Skip to content

Boolean flag default to true set to false through CLI is interpreted as a string #6924

@VasLem

Description

@VasLem

Bug report

Currently there is no way to set a boolean flag defaulting to true to false naturally, unless you set it as typed.

Minimal example:

params.flag = true
process test {
script:
if (params.flag) {
    println "Flag is true"
} else {
    println "Flag is false"
}
"""
echo ${params.flag}
"""
}

workflow {
main:
test()
}

Run:

nextflow run test.nf --flag false

 N E X T F L O W   ~  version 26.02.0-edge

Launching `test.nf` [nauseous_visvesvaraya] revision: d3b98b5758

executor >  local (1)
[9d/b25e5a] test | 1 of 1 ✔
Flag is true

Expected behavior and actual behavior

I would expect to have the flag set to false, or at least have a way to do so, without using a typed param. This goes totally against the old CLI behavior.

Environment

  • Nextflow version: 26.02.0-edge

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions