use of org.apache.commons.cli.CommandLineParser in project mysql_perf_analyzer by yahoo.
the class App method main.
/* -p --port 9090
* -r --webcontextroot webapps
* -l --logpath logpath
* -w --war webapp war file name
*/
public static void main(String[] args) throws Exception {
App myServer = new App();
CommandLineParser parser = new GnuParser();
Options options = getAvaliableCommandLineOptions();
System.out.println(new Date() + " Usage: java -classpath ... com.yahoo.dba.tools.myperfserver.App -j jettyhome " + "-p port -c webcontextroot -k workingDir -l logpath -w war_file");
readOptionsFromCommandLine(args, parser, options, myServer);
System.setProperty("logPath", myServer.getLogDirectoryPath());
PID_FILE = myServer.getWarFile().substring(0, myServer.getWarFile().indexOf('.')) + ".pid";
checksRunningOfAnotherServerInstance();
runServer(myServer);
}
use of org.apache.commons.cli.CommandLineParser in project midpoint by Evolveum.
the class AbstractWebServiceClient method parseCommandLine.
private void parseCommandLine(String[] args) throws ParseException {
CommandLineParser cliParser = new GnuParser();
commandLine = cliParser.parse(options, args, true);
if (commandLine.hasOption('h')) {
printHelp();
System.exit(0);
}
if (commandLine.hasOption('v')) {
verbose = true;
}
}
use of org.apache.commons.cli.CommandLineParser in project goci by EBISPOT.
the class ParentMappingApplication method parseArguments.
private static int parseArguments(String[] args) {
CommandLineParser parser = new GnuParser();
HelpFormatter help = new HelpFormatter();
Options options = bindOptions();
int parseArgs = 0;
try {
CommandLine cl = parser.parse(options, args, true);
// check for mode help option
if (cl.hasOption("")) {
// print out mode help
help.printHelp("mapper", options, true);
parseArgs += 1;
} else {
// find -o option (for asserted output file)
if (cl.hasOption("o")) {
outputFile = new File(cl.getOptionValue("o"));
} else {
System.err.println("-o (output file) argument is required");
help.printHelp("mapper", options, true);
parseArgs += 2;
}
}
} catch (ParseException e) {
System.err.println("Failed to read supplied arguments");
help.printHelp("mapper", options, true);
parseArgs += 4;
}
return parseArgs;
}
use of org.apache.commons.cli.CommandLineParser in project goci by EBISPOT.
the class AssociationFilterApplication method parseArguments.
private static int parseArguments(String[] args) {
CommandLineParser parser = new GnuParser();
HelpFormatter help = new HelpFormatter();
Options options = bindOptions();
int parseArgs = 0;
try {
CommandLine cl = parser.parse(options, args, true);
// check for mode help option
if (cl.hasOption("")) {
// print out mode help
help.printHelp("filter", options, true);
parseArgs += 1;
} else {
// find -o option (for asserted output file)
if (cl.hasOption("o")) {
outputFile = new File(cl.getOptionValue("o"));
} else {
System.err.println("-o (output file) argument is required");
help.printHelp("filter", options, true);
parseArgs += 2;
}
if (cl.hasOption("f")) {
inputFile = new File(cl.getOptionValue("f"));
} else {
System.err.println("-f (input file) argument is required");
help.printHelp("filter", options, true);
parseArgs += 2;
}
if (cl.hasOption("p")) {
prune = true;
}
if (cl.hasOption("t")) {
threshold = Double.valueOf(cl.getOptionValue("t"));
}
}
} catch (ParseException e) {
System.err.println("Failed to read supplied arguments");
help.printHelp("filter", options, true);
parseArgs += 4;
}
return parseArgs;
}
use of org.apache.commons.cli.CommandLineParser in project goci by EBISPOT.
the class SnpListBuilderApp method parseArguments.
private static int parseArguments(String[] args) {
CommandLineParser parser = new GnuParser();
HelpFormatter help = new HelpFormatter();
Options options = bindOptions();
int parseArgs = 0;
try {
CommandLine cl = parser.parse(options, args, true);
// check for mode help option
if (cl.hasOption("")) {
// print out mode help
help.printHelp("publish", options, true);
parseArgs += 1;
} else {
// find -o option (for asserted output file)
if (cl.hasOption("o")) {
outputFilePath = cl.getOptionValue("o");
} else {
System.err.println("-o (ontology output file) argument is required");
help.printHelp("publish", options, true);
parseArgs += 2;
}
}
} catch (ParseException e) {
System.err.println("Failed to read supplied arguments");
help.printHelp("publish", options, true);
parseArgs += 3;
}
return parseArgs;
}
Aggregations