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

The following examples show how to use com.martiansoftware.jsap.FlaggedOption#setStringParser() . 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 defineArgSmtpUsername() {
    FlaggedOption opt = new FlaggedOption("smtpUsername");
    opt.setLongFlag("smtpUsername");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Username for authorized server");
    return opt;
}
 
Example 3
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 4
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 5
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 6
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 7
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
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 on the format https://github.com/user/repo.");
    return opt;
}
 
Example 8
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 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 defineArgNotifyto() {
    FlaggedOption opt = new FlaggedOption("notifyto");
    opt.setLongFlag("notifyto");
    opt.setList(true);
    opt.setListSeparator(',');
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Specify email addresses to notify");
    return opt;
}
 
Example 11
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgSmtpPassword() {
    FlaggedOption opt = new FlaggedOption("smtpPassword");
    opt.setLongFlag("smtpPassword");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Password for authorized server");
    return opt;
}
 
Example 12
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 13
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgSmtpServer() {
    FlaggedOption opt = new FlaggedOption("smtpServer");
    opt.setLongFlag("smtpServer");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Specify SMTP server to use for Email notification");
    return opt;
}
 
Example 14
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 15
Source File: LauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgMongoDBHost() {
    FlaggedOption opt = new FlaggedOption("mongoDBHost");
    opt.setLongFlag("dbhost");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Specify mongodb host.");
    return opt;
}
 
Example 16
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 17
Source File: GitRepositoryLauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgGitRepositoryIdCommit() {
    FlaggedOption opt = new FlaggedOption("gitRepositoryIdCommit");
    opt.setLongFlag("gitrepoidcommit");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Specify the commit id of the given repository (only in GIT_REPOSITORY mode).");
    return opt;
}
 
Example 18
Source File: GitRepositoryLauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgGitRepositoryBranch() {
    FlaggedOption opt = new FlaggedOption("gitRepositoryBranch");
    opt.setLongFlag("gitrepobranch");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Specify a branch of the given repository (only in GIT_REPOSITORY mode)");
    return opt;
}
 
Example 19
Source File: GitRepositoryLauncherUtils.java    From repairnator with MIT License 5 votes vote down vote up
public static FlaggedOption defineArgGitRepositoryUrl() {
    FlaggedOption opt = new FlaggedOption("gitRepositoryUrl");
    opt.setLongFlag("gitrepourl");
    opt.setStringParser(JSAP.STRING_PARSER);
    opt.setHelp("Specify a Git repository URL (only in GIT_REPOSITORY mode).");
    return opt;
}
 
Example 20
Source File: CheckBranchLauncher.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());
    // -i or --input
    jsap.registerParameter(LauncherUtils.defineArgBranchInput());
    // -o or --output
    jsap.registerParameter(LauncherUtils.defineArgOutput(LauncherType.CHECKBRANCHES, "Specify where to put output data"));
    // --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());
    // -t or --threads
    jsap.registerParameter(LauncherUtils.defineArgNbThreads());
    // -g or --globalTimeout
    jsap.registerParameter(LauncherUtils.defineArgGlobalTimeout());

    Switch sw1 = new Switch("humanPatch");
    sw1.setShortFlag('p');
    sw1.setLongFlag("humanPatch");
    sw1.setDefault("false");
    jsap.registerParameter(sw1);

    FlaggedOption opt2 = new FlaggedOption("repository");
    opt2.setShortFlag('r');
    opt2.setLongFlag("repository");
    opt2.setStringParser(JSAP.STRING_PARSER);
    opt2.setRequired(true);
    opt2.setHelp("Specify where to collect branches");
    jsap.registerParameter(opt2);

    return jsap;
}