use of org.kohsuke.args4j.CmdLineParser in project ORCID-Source by ORCID.
the class DeleteOrcidByIdentifier method main.
public static void main(String[] args) {
DeleteOrcidByIdentifier deleteOrcidByIdentifier = new DeleteOrcidByIdentifier();
CmdLineParser parser = new CmdLineParser(deleteOrcidByIdentifier);
try {
parser.parseArgument(args);
deleteOrcidByIdentifier.validateArgs(parser);
deleteOrcidByIdentifier.execute();
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
}
}
use of org.kohsuke.args4j.CmdLineParser in project ORCID-Source by ORCID.
the class CreateNewClientSecrets method main.
public static void main(String[] args) {
CreateNewClientSecrets createNewClientSecrets = new CreateNewClientSecrets();
CmdLineParser parser = new CmdLineParser(createNewClientSecrets);
try {
parser.parseArgument(args);
createNewClientSecrets.validateArgs(parser);
createNewClientSecrets.execute();
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
} finally {
System.exit(0);
}
}
use of org.kohsuke.args4j.CmdLineParser in project ORCID-Source by ORCID.
the class DeleteWorkByIdentifier method main.
public static void main(String[] args) {
DeleteWorkByIdentifier deleteWorkByIdentifier = new DeleteWorkByIdentifier();
CmdLineParser parser = new CmdLineParser(deleteWorkByIdentifier);
try {
parser.parseArgument(args);
deleteWorkByIdentifier.validateArgs(parser);
deleteWorkByIdentifier.execute();
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
}
}
use of org.kohsuke.args4j.CmdLineParser in project gerrit by GerritCodeReview.
the class AsciiDoctor method invoke.
private void invoke(String... parameters) throws IOException {
CmdLineParser parser = new CmdLineParser(this);
try {
parser.parseArgument(parameters);
if (inputFiles.isEmpty()) {
throw new CmdLineException(parser, "asciidoctor: FAILED: input file missing");
}
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.exit(1);
return;
}
if (revnumberFile != null) {
try (BufferedReader reader = new BufferedReader(new FileReader(revnumberFile))) {
revnumber = reader.readLine();
}
}
if (mktmp) {
tmpdir = Files.createTempDirectory("asciidoctor-").toFile();
}
if (bazel) {
renderFiles(inputFiles, null);
} else {
try (ZipOutputStream zip = new ZipOutputStream(Files.newOutputStream(Paths.get(zipFile)))) {
renderFiles(inputFiles, zip);
File[] cssFiles = tmpdir.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.endsWith(".css");
}
});
for (File css : cssFiles) {
zipFile(css, css.getName(), zip);
}
}
}
}
use of org.kohsuke.args4j.CmdLineParser in project asterixdb by apache.
the class AsterixClientDriver method main.
public static void main(String[] args) throws Exception {
AsterixClientConfig acc = new AsterixClientConfig();
CmdLineParser cmdParser = new CmdLineParser(acc);
try {
cmdParser.parseArgument(args);
} catch (Exception e) {
cmdParser.printUsage(System.err);
throw e;
}
if (acc.getArguments().isEmpty()) {
System.err.println("Please specify the file containing the query.");
return;
}
if (acc.getArguments().size() > 1) {
System.err.print("Too many arguments. ");
System.err.println("Only the file contained the query needs to be specified.");
return;
}
boolean exec = new Boolean(acc.execute);
IHyracksClientConnection hcc = exec ? new HyracksConnection("localhost", acc.hyracksPort) : null;
AsterixJavaClient q = compileQuery(hcc, acc.getArguments().get(0), new Boolean(acc.optimize), new Boolean(acc.onlyPhysical), exec || new Boolean(acc.hyracksJob));
if (exec) {
q.execute();
}
}
Aggregations