Skip to content

Commit

Permalink
[FIXED JENKINS-22924] - Allow the parameter specification from Jenkin…
Browse files Browse the repository at this point in the history
…s CLI

The parameter takes the comma-separated list of values.

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
  • Loading branch information
oleg-nenashev committed May 9, 2014
1 parent aa7d247 commit 9bc7ad7
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -38,6 +38,7 @@
import org.kohsuke.stapler.StaplerRequest;

import au.com.bytecode.opencsv.CSVReader;
import hudson.cli.CLICommand;

public class ExtendedChoiceParameterDefinition extends ParameterDefinition {
private static final long serialVersionUID = -2946187268529865645L;
Expand Down Expand Up @@ -184,6 +185,16 @@ private Map<String, Boolean> computeDefaultValueMap() {
@Override
public ParameterValue createValue(StaplerRequest request) {
String[] requestValues = request.getParameterValues(getName());
return createValue(requestValues);
}

@Override
public ParameterValue createValue(CLICommand command, String value) throws IOException, InterruptedException {
String[] requestValues = (value != null) ? value.split(",") : null;
return createValue(requestValues);
}

/*package*/ ParameterValue createValue(String[] requestValues) {
if(requestValues == null || requestValues.length == 0) {
return getDefaultParameterValue();
}
Expand Down

0 comments on commit 9bc7ad7

Please sign in to comment.