Because then bash interprets the quoted string as ...
# nf-schema
j
Because then bash interprets the quoted string as a another pipeline variable:
--kmcp_compute_options="-k 33"
becomes
--kmcp_compute_options "-k 33"
which then Nextflow thinks
-k 33
is a pipeline parameter
p
Really?
j
Yup
p
<http://main.nf|main.nf>
Copy code
println("test" + params.test)
println("k: " + params.k)
Copy code
❯ nextflow run <http://main.nf|main.nf> --test "-k 33"

 N E X T F L O W   ~  version 25.10.0

Launching `<http://main.nf|main.nf>` [peaceful_archimedes] DSL2 - revision: 861e53ea7b

test-k 33
WARN: Access to undefined parameter `k` -- Initialise it to a default value eg. `params.k = some_value`
k: null
I don't see it?
j
But it's interpreting
-k
as a pipeline parameter there
p
Also works with `=`:
Copy code
❯ nextflow run <http://main.nf|main.nf> --test="-k 33"

 N E X T F L O W   ~  version 25.10.0

Launching `<http://main.nf|main.nf>` [reverent_shannon] DSL2 - revision: dfa4c74f2b

test: -k 33
WARN: Access to undefined parameter `k` -- Initialise it to a default value eg. `params.k = some_value`
k: null
j
Not with nf-core
which is using nf-schema
p
But it's interpreting
-k
as a pipeline parameter there
No it isn't, it's a string?
j
WARN: Access to undefined parameter
k
-- Initialise it to a default value eg.
params.k = some_value
p
Yes, because of this:;
Copy code
println("k: " + params.k)
j
Ah got you sorry
p
If I remove the
println
then that warning goes away
j
> Also works with = And yes that's my expectation and it works with NExtflow itself
But when I do that pattern with nf-schema it complains about a boolean
p
From memory, nf-schema just uses
params
from Nextflow
party this 1
j
one sec, I can give you the place it's happening
a command*
Copy code
nextflow run nf-core/createtaxdb -r 1.0.0 -profile test_minimal,docker --outdir output --build_kmcp --kmcp_build_options="-k 33"
Makes
Copy code
* --build_kmcp (--kmcp_build_options=-k 33): Value is [string] but should be [boolean]
p
Try this:
Copy code
nextflow run nf-core/createtaxdb -r 1.0.0 -profile test_minimal,docker  --kmcp_build_options="-k 33" --build_kmcp
(gotta run so no time to try it myself sorry)
j
OK yeah, flipping it works... what...? why?
😅 1
🎉 1
Copy code
--kmcp_build_options="-k 33" --build_kmcp
works, but
Copy code
--build_kmcp --kmcp_build_options="-k 33"
complains ...
m
interesting
n
Have you tried single quotes?
j
Copy code
nextflow run nf-core/createtaxdb -r 1.0.0 -profile test_minimal,docker --outdir output_foo --build_kmcp --kmcp_buil
d_options='-k 33'
Copy code
ERROR ~ Validation of pipeline parameters failed!

 -- Check '.nextflow.log' file for details
The following invalid input values have been detected:

* --build_kmcp (--kmcp_build_options=-k 33): Value is [string] but should be [boolean]
n
Congrats! You found a Nextflow bug 😁
🫠 1
p
For me with a minimal example it works fine without the
=
<http://main.nf|main.nf>
Copy code
println(params.test)
println(params.bool)
✅ Bool flag last
Copy code
❯ nextflow run <http://main.nf|main.nf> --test="-k 33" --bool

 N E X T F L O W   ~  version 25.10.0

Launching `<http://main.nf|main.nf>` [peaceful_gilbert] DSL2 - revision: 233480640e

-k 33
true
❌ Bool flag first, second param using
=
Copy code
❯ nextflow run <http://main.nf|main.nf> --bool --test="-k 33"

 N E X T F L O W   ~  version 25.10.0

Launching `<http://main.nf|main.nf>` [zen_engelbart] DSL2 - revision: 233480640e

WARN: Access to undefined parameter `test` -- Initialise it to a default value eg. `params.test = some_value`
null
--test=-k 33
✅ Bool flag first, no
=
Copy code
❯ nextflow run <http://main.nf|main.nf> --bool --test "-k 33"

 N E X T F L O W   ~  version 25.10.0

Launching `<http://main.nf|main.nf>` [compassionate_brahmagupta] DSL2 - revision: 233480640e

-k 33
true
Which I guess takes us back to the original command. But you say this doesn't work @James Fellows Yates?
Copy code
nextflow run nf-core/createtaxdb -r 1.0.0 -profile test_minimal,docker --outdir output --build_kmcp --kmcp_build_options "-k 33"
j
Yes, Boolean doesn't work
nextflow run nf-core/createtaxdb -r 1.0.0 -profile test_minimal,docker --outdir output_foo --build_kmcp --kmcp_build_options='-k 33'
ERROR ~ Validation of pipeline parameters failed! -- Check '.nextflow.log' file for details The following invalid input values have been detected: * --build_kmcp (--kmcp_build_options=-k 33): Value is [string] but should be [boolean]
n
Does it work if you use
true
as the boolean value?
👀 1
j
And for the other option without
=
I have to send later, taking my daughter to the ice rink atm
But you can try
It might not work without
=
because then we get quoting issues
ARG WTF
Now it all works (except for boolean ->
=
) https://hackmd.io/@nf-core/HJq5oGzxWg
So what the fucking fuck error messages I was getting before and spent an hour trying to debug fuck knows
table flip
Im' so pissed right now
n
shared a GIF
j
Pretty uch
p
hah, I had a feeling this was going to end this way somehow 😅
j
Sorry about that...
I'm still suspcious though... I was only experimenting with this as I had similar issues before the first release where I wrote a bunch of documentation about quotes and double quotes and shit...
So I don't know what I'm doing wrong...
both then and nw
or rather earlier
a
I feel like I went through this whole thing myself at some point a couple of years back but I can't find any threads I opened on it. I have a feeling I went mad from trying to understand and just gave up and switched to exclusively passing parameters via a yml file
😂 3
j
Ok it's good to know it's not just me.... I'll try to be more systematic next time it comes up again...
p
Minimal examples plsssss 🙏🏻
😬 1
Note that we have a CLI v2 on the roadmap for next year 👀 🤫 eyebrows
👀 1
🎉 1
Partly because of this kind of shit
a
Anywhere to lodge requests/opinions for v2? (Array-type arg declarations using multiple copies of a param pls 🙏🏻)
👀 1
j
Sorry @Phil Ewels 😅 you are right. To be fair I was getting like 5 different so it was sort of hard to know what was the right reprex to make. But V2 sounds exciting!
👍🏻 1
p
@Arthur github issue? But don't let on that I told you anything 😆