Java Code Examples for com.martiansoftware.jsap.FlaggedOption#setDefault()

The following examples show how to use com.martiansoftware.jsap.FlaggedOption#setDefault() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BranchLauncher.java    From repairnator with MIT License 6 votes vote down vote up
public static JSAP defineBasicArgs() throws JSAPException {
	JSAP jsap = new JSAP();

	FlaggedOption opt2 = new FlaggedOption("launcherMode");
       opt2.setShortFlag('l');
       opt2.setLongFlag("launcherMode");
       opt2.setStringParser(JSAP.STRING_PARSER);
       opt2.setDefault(LauncherMode.REPAIR.name());
       opt2.setHelp("specify launcherMode." 
       	+ "REPAIR: standard repairnator repair with Travis build ids. BEARS: analyze pairs of bugs and human-produced patches. "
       	+ "CHECKSTYLE: analyze build failing because of checkstyle. "
       	+ "GIT_REPOSITORY: repairnator repair with Git instead of standard Travis. "
       	+ "KUBERNETES_LISTENER: run repairnator as a Activemq server listening for Travis build ids. ");
       jsap.registerParameter(opt2);

       return jsap;
}
 
Example 2
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgRunId() {
    FlaggedOption opt = new FlaggedOption("runId");
    opt.setLongFlag("runId");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setDefault("1234");
    opt.setHelp("Specify the run id for this launch.");
    return opt;
}
 
Example 3
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgInput() {
    /* ./builds.txt contain one build id per line

        346537408
        347223109
        348887356
        349620528
        351046304
        353774072
        358555930
        361311603
        368867994
        369727490
        369854684
        369859631
        370885458
        371144762
        371488143
        374841318
        376812142

        (this is the list from Expedition 2)
     */
    FlaggedOption opt = new FlaggedOption("input");
    opt.setShortFlag('i');
    opt.setLongFlag("input");
    opt.setDefault("./builds.txt");
    opt.setHelp("Specify the input file containing the list of build ids.");
    return opt;
}
 
Example 4
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgProjectInput() {
    /* ./projects.txt contain one slug per line

    INRIA/spoon
    rails/rails
    ....
     */
    FlaggedOption opt = new FlaggedOption("input");
    opt.setShortFlag('i');
    opt.setLongFlag("input");
    opt.setDefault("./projects.txt");
    opt.setHelp("Specify where to find the list of projects to scan.");
    return opt;
}
 
Example 5
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgBranchInput() {
    /* ./branches.txt contain one branch per line
        typically from https://github.com/Spirals-Team/librepair-experiments/
     */
    FlaggedOption opt = new FlaggedOption("input");
    opt.setShortFlag('i');
    opt.setLongFlag("input");
    opt.setDefault("./projects.txt");
    opt.setHelp("Specify the input file containing the list of branches to reproduce (one branch per line)");
    return opt;
}
 
Example 6
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgOutput(LauncherType launcherType, String helpMessage) {
    FlaggedOption opt = new FlaggedOption("output");
    opt.setShortFlag('o');
    opt.setLongFlag("output");
    // we don't assume the presence of "/tmp" (eg on windows) and the it is writable
    opt.setDefault("./repairnator-output");
    if (launcherType == LauncherType.DOCKERPOOL || launcherType == LauncherType.CHECKBRANCHES) {
        opt.setRequired(true);
    }

    opt.setHelp(helpMessage);

    return opt;
}
 
Example 7
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgMongoDBName() {
    FlaggedOption opt = new FlaggedOption("mongoDBName");
    opt.setLongFlag("dbname");
    opt.setDefault("repairnator");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Specify mongodb DB name.");
    return opt;
}
 
Example 8
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgSmtpPort() {
    FlaggedOption opt = new FlaggedOption("smtpPort");
    opt.setLongFlag("smtpPort");
    opt.setStringParser(JSAP.INTEGER_PARSER);
    opt.setDefault("25");
    opt.setHelp("The port on which to contact the SMTP server. Default 25");
    return opt;
}
 
Example 9
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgNbThreads() {
    FlaggedOption opt = new FlaggedOption("threads");
    opt.setShortFlag('t');
    opt.setLongFlag("threads");
    opt.setStringParser(JSAP.INTEGER_PARSER);
    opt.setDefault("1");
    opt.setHelp("Specify the number of threads to run in parallel");
    return opt;
}
 
Example 10
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgGlobalTimeout() {
    FlaggedOption opt = new FlaggedOption("globalTimeout");
    opt.setShortFlag('g');
    opt.setLongFlag("globalTimeout");
    opt.setStringParser(JSAP.INTEGER_PARSER);
    opt.setDefault("1");
    opt.setHelp("Specify the number of day before killing the whole pool.");
    return opt;
}
 
Example 11
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgDockerImageName() {
    FlaggedOption opt = new FlaggedOption("imageName");
    opt.setShortFlag('n');
    opt.setLongFlag("name");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setDefault("repairnator/pipeline:latest");
    opt.setHelp("Specify the docker image name to use.");
    return opt;
}
 
Example 12
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgGithubOAuth() {
    FlaggedOption opt = new FlaggedOption("ghOauth");
    opt.setLongFlag("ghOauth");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setDefault(System.getenv("GITHUB_OAUTH"));
    opt.setHelp("Specify Github Token to use");
    return opt;
}
 
Example 13
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgGithubUserName() {
    FlaggedOption opt = new FlaggedOption("githubUserName");
    opt.setLongFlag("githubUserName");
    opt.setDefault("repairnator");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Specify the name of the user who commits");
    return opt;
}
 
Example 14
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgGithubUserEmail() {
    FlaggedOption opt = new FlaggedOption("githubUserEmail");
    opt.setLongFlag("githubUserEmail");
    opt.setDefault("[email protected]");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Specify the email of the user who commits");
    return opt;
}
 
Example 15
Source File: BuildAnalyzerLauncher.java    From repairnator with MIT License 4 votes vote down vote up
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());
    // --bears
    jsap.registerParameter(LauncherUtils.defineArgBearsMode());
    // --checkstyle
    jsap.registerParameter(LauncherUtils.defineArgCheckstyleMode());
    // -i or --input
    jsap.registerParameter(LauncherUtils.defineArgInput());
    // -o or --output
    jsap.registerParameter(LauncherUtils.defineArgOutput(LauncherType.DOCKERPOOL,"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());
    // --smtpPort 
    jsap.registerParameter(LauncherUtils.defineArgSmtpPort());
    // --smtpTLS
    jsap.registerParameter(LauncherUtils.defineArgSmtpTLS());
    // --smtpUsername
    jsap.registerParameter(LauncherUtils.defineArgSmtpUsername());
    // --smtpPassword
    jsap.registerParameter(LauncherUtils.defineArgSmtpPassword());
    // --notifyto
    jsap.registerParameter(LauncherUtils.defineArgNotifyto());
    // -n or --name
    jsap.registerParameter(LauncherUtils.defineArgDockerImageName());
    // --skipDelete
    jsap.registerParameter(LauncherUtils.defineArgSkipDelete());
    // --createOutputDir
    jsap.registerParameter(LauncherUtils.defineArgCreateOutputDir());
    // -t or --threads
    jsap.registerParameter(LauncherUtils.defineArgNbThreads());
    // -g or --globalTimeout
    jsap.registerParameter(LauncherUtils.defineArgGlobalTimeout());
    // --pushurl
    jsap.registerParameter(LauncherUtils.defineArgPushUrl());
    // --ghOauth
    jsap.registerParameter(LauncherUtils.defineArgGithubOAuth());
    // --githubUserName
    jsap.registerParameter(LauncherUtils.defineArgGithubUserName());
    // --githubUserEmail
    jsap.registerParameter(LauncherUtils.defineArgGithubUserEmail());
    // --createPR
    jsap.registerParameter(LauncherUtils.defineArgCreatePR());

    FlaggedOption opt2 = new FlaggedOption("repairTools");
    opt2.setLongFlag("repairTools");
    opt2.setList(true);
    opt2.setListSeparator(',');
    opt2.setHelp("Specify one or several repair tools to use separated by commas (available tools might depend of your docker image)");
    opt2.setDefault("NopolAllTests");
    jsap.registerParameter(opt2);

    return jsap;
}