Skip to content

Commit

Permalink
Merge pull request #5 from synopsys-arc-oss/CLI_call_support
Browse files Browse the repository at this point in the history
 [FIXED JENKINS-22924] - Added support of CLI
  • Loading branch information
vimil committed May 9, 2014
2 parents aa7d247 + 1dedb1e commit ac18a81
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target/
/work/
Original file line number Diff line number Diff line change
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 ac18a81

Please sign in to comment.