From 3910c72f6a23eb52f438d08b25b657582c5b6683 Mon Sep 17 00:00:00 2001 From: jorge aguilera Date: Mon, 6 Jan 2025 14:19:50 +0100 Subject: [PATCH] allows parameters when run a plugin --- .../src/main/groovy/nextflow/cli/CmdPlugin.groovy | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdPlugin.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdPlugin.groovy index 370508f49b..2cb0d1df3d 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdPlugin.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdPlugin.groovy @@ -17,6 +17,7 @@ package nextflow.cli +import com.beust.jcommander.DynamicParameter import com.beust.jcommander.Parameter import com.beust.jcommander.Parameters import groovy.transform.CompileStatic @@ -38,6 +39,9 @@ class CmdPlugin extends CmdBase { return 'plugin' } + @DynamicParameter(names = "--", description = "Custom plugin parameters go here", hidden = true) + private Map params = new HashMap<>(); + @Parameter(hidden = true) List args @@ -69,6 +73,12 @@ class CmdPlugin extends CmdBase { throw new AbortOperationException("Cannot find target plugin: $target") final plugin = wrapper.getPlugin() if( plugin instanceof PluginExecAware ) { + def mapped = [] as List + params.entrySet().each{ + mapped << "--$it.key".toString() + mapped << "$it.value".toString() + } + args.addAll(mapped) final ret = plugin.exec(getLauncher(), target, cmd, args) // use explicit exit to invoke the system shutdown hooks System.exit(ret)