Skip to content

Commit f81da8c

Browse files
jagednbentsherman
andauthored
Allow named parameters with plugin subcommand (#5643) [ci fast]
Co-authored-by: Ben Sherman <bentshermann@gmail.com>
1 parent 1878836 commit f81da8c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

modules/nextflow/src/main/groovy/nextflow/cli/CmdPlugin.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package nextflow.cli
1919

20+
import com.beust.jcommander.DynamicParameter
2021
import com.beust.jcommander.Parameter
2122
import com.beust.jcommander.Parameters
2223
import groovy.transform.CompileStatic
@@ -38,6 +39,9 @@ class CmdPlugin extends CmdBase {
3839
return 'plugin'
3940
}
4041

42+
@DynamicParameter(names = "--", description = "Custom plugin parameters go here", hidden = true)
43+
private Map<String, String> params = new HashMap<>();
44+
4145
@Parameter(hidden = true)
4246
List<String> args
4347

@@ -69,6 +73,12 @@ class CmdPlugin extends CmdBase {
6973
throw new AbortOperationException("Cannot find target plugin: $target")
7074
final plugin = wrapper.getPlugin()
7175
if( plugin instanceof PluginExecAware ) {
76+
def mapped = [] as List<String>
77+
params.entrySet().each{
78+
mapped << "--$it.key".toString()
79+
mapped << "$it.value".toString()
80+
}
81+
args.addAll(mapped)
7282
final ret = plugin.exec(getLauncher(), target, cmd, args)
7383
// use explicit exit to invoke the system shutdown hooks
7484
System.exit(ret)

0 commit comments

Comments
 (0)