use of hudson.cli.declarative.CLIResolver in project hudson-2.x by hudson.
the class Job method getBuildForCLI.
@CLIResolver
public RunT getBuildForCLI(@Argument(required = true, metaVar = "BUILD#", usage = "Build number") String id) throws CmdLineException {
try {
int n = Integer.parseInt(id);
RunT r = getBuildByNumber(n);
if (r == null)
throw new CmdLineException(null, "No such build '#" + n + "' exists");
return r;
} catch (NumberFormatException e) {
throw new CmdLineException(null, id + "is not a number");
}
}
Aggregations