use of com.martiansoftware.jsap.FlaggedOption in project repairnator by Spirals-Team.
the class RTLauncher method defineArgs.
private JSAP defineArgs() throws JSAPException {
// Verbose output
JSAP jsap = new JSAP();
// -h or --help
jsap.registerParameter(LauncherUtils.defineArgHelp());
// -d or --debug
jsap.registerParameter(LauncherUtils.defineArgDebug());
// --runId
jsap.registerParameter(LauncherUtils.defineArgRunId());
// -o or --output
jsap.registerParameter(LauncherUtils.defineArgOutput(LauncherType.REALTIME, "Specify where to put serialized files from dockerpool"));
// --dbhost
jsap.registerParameter(LauncherUtils.defineArgMongoDBHost());
// --dbname
jsap.registerParameter(LauncherUtils.defineArgMongoDBName());
// --notifyEndProcess
jsap.registerParameter(LauncherUtils.defineArgNotifyEndProcess());
// --smtpServer
jsap.registerParameter(LauncherUtils.defineArgSmtpServer());
// --notifyto
jsap.registerParameter(LauncherUtils.defineArgNotifyto());
// -n or --name
jsap.registerParameter(LauncherUtils.defineArgDockerImageName());
// --skipDelete
jsap.registerParameter(LauncherUtils.defineArgSkipDelete());
// --createOutputDir
jsap.registerParameter(LauncherUtils.defineArgCreateOutputDir());
// -l or --logDirectory
jsap.registerParameter(LauncherUtils.defineArgLogDirectory());
// -t or --threads
jsap.registerParameter(LauncherUtils.defineArgNbThreads());
// --pushurl
jsap.registerParameter(LauncherUtils.defineArgPushUrl());
FlaggedOption opt2 = new FlaggedOption("whitelist");
opt2.setShortFlag('w');
opt2.setLongFlag("whitelist");
opt2.setStringParser(FileStringParser.getParser().setMustBeDirectory(false).setMustExist(true));
opt2.setHelp("Specify the path of whitelisted repository");
jsap.registerParameter(opt2);
opt2 = new FlaggedOption("blacklist");
opt2.setShortFlag('b');
opt2.setLongFlag("blacklist");
opt2.setStringParser(FileStringParser.getParser().setMustBeDirectory(false).setMustExist(true));
opt2.setHelp("Specify the path of blacklisted repository");
jsap.registerParameter(opt2);
opt2 = new FlaggedOption("jobsleeptime");
opt2.setLongFlag("jobsleeptime");
opt2.setStringParser(JSAP.INTEGER_PARSER);
opt2.setDefault(InspectJobs.JOB_SLEEP_TIME + "");
opt2.setHelp("Specify the sleep time between two requests to Travis Job endpoint (in seconds)");
jsap.registerParameter(opt2);
opt2 = new FlaggedOption("buildsleeptime");
opt2.setLongFlag("buildsleeptime");
opt2.setStringParser(JSAP.INTEGER_PARSER);
opt2.setDefault(InspectBuilds.BUILD_SLEEP_TIME + "");
opt2.setHelp("Specify the sleep time between two refresh of build statuses (in seconds)");
jsap.registerParameter(opt2);
opt2 = new FlaggedOption("maxinspectedbuilds");
opt2.setLongFlag("maxinspectedbuilds");
opt2.setStringParser(JSAP.INTEGER_PARSER);
opt2.setDefault(InspectBuilds.LIMIT_SUBMITTED_BUILDS + "");
opt2.setHelp("Specify the maximum number of watched builds");
jsap.registerParameter(opt2);
opt2 = new FlaggedOption("duration");
opt2.setLongFlag("duration");
opt2.setStringParser(PeriodStringParser.getParser());
opt2.setHelp("Duration of the execution. If not given, the execution never stop. This argument should be given on the ISO-8601 duration format: PWdTXhYmZs where W, X, Y, Z respectively represents number of Days, Hours, Minutes and Seconds. T is mandatory before the number of hours and P is always mandatory.");
jsap.registerParameter(opt2);
return jsap;
}
use of com.martiansoftware.jsap.FlaggedOption in project repairnator by Spirals-Team.
the class LauncherUtils method defineArgRunId.
public static FlaggedOption defineArgRunId() {
FlaggedOption opt = new FlaggedOption("runId");
opt.setLongFlag("runId");
opt.setStringParser(JSAP.STRING_PARSER);
opt.setHelp("Specify the run id for this launch.");
return opt;
}
use of com.martiansoftware.jsap.FlaggedOption in project repairnator by Spirals-Team.
the class LauncherUtils method defineArgPushUrl.
public static FlaggedOption defineArgPushUrl() {
FlaggedOption opt = new FlaggedOption("pushUrl");
opt.setLongFlag("pushurl");
opt.setStringParser(JSAP.STRING_PARSER);
opt.setHelp("Specify repository URL to push data.");
return opt;
}
use of com.martiansoftware.jsap.FlaggedOption in project repairnator by Spirals-Team.
the class LauncherUtils method defineArgInput.
public static FlaggedOption defineArgInput(String helpMessage) {
FlaggedOption opt = new FlaggedOption("input");
opt.setShortFlag('i');
opt.setLongFlag("input");
opt.setStringParser(FileStringParser.getParser().setMustExist(true).setMustBeFile(true));
opt.setRequired(true);
opt.setHelp(helpMessage);
return opt;
}
use of com.martiansoftware.jsap.FlaggedOption in project repairnator by Spirals-Team.
the class LauncherUtils method defineArgLauncherMode.
public static FlaggedOption defineArgLauncherMode(String helpMessage) {
String launcherModeValues = "";
for (LauncherMode mode : LauncherMode.values()) {
launcherModeValues += mode.name() + ";";
}
launcherModeValues = launcherModeValues.substring(0, launcherModeValues.length() - 1);
FlaggedOption opt = new FlaggedOption("launcherMode");
opt.setShortFlag('m');
opt.setLongFlag("launcherMode");
opt.setStringParser(EnumeratedStringParser.getParser(launcherModeValues));
opt.setRequired(true);
opt.setHelp(helpMessage);
return opt;
}
Aggregations