Skip to content

Commit

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

The parameter takes the comma-separated list of values.

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

Conflicts:
	src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java
  • Loading branch information
oleg-nenashev committed Oct 13, 2014
1 parent 5bede41 commit 8dd582e
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -41,6 +41,7 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.Reader;
import hudson.cli.CLICommand;

public class ExtendedChoiceParameterDefinition extends ParameterDefinition {
private static final long serialVersionUID = -2946187268529865645L;
Expand Down Expand Up @@ -187,6 +188,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 8dd582e

Please sign in to comment.