Search in sources :

Example 16 with CmdLineException

use of org.kohsuke.args4j.CmdLineException in project ORCID-Source by ORCID.

the class IndexProfiles method main.

public static void main(String[] args) throws IOException {
    IndexProfiles indexProfiles = new IndexProfiles();
    CmdLineParser parser = new CmdLineParser(indexProfiles);
    try {
        parser.parseArgument(args);
        indexProfiles.validateArgs(parser);
        indexProfiles.init();
        indexProfiles.execute();
    } catch (CmdLineException e) {
        System.err.println(e.getMessage());
        parser.printUsage(System.err);
        System.exit(1);
    } catch (Throwable t) {
        System.err.println(t);
        System.exit(2);
    }
    System.exit(0);
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) CmdLineException(org.kohsuke.args4j.CmdLineException)

Example 17 with CmdLineException

use of org.kohsuke.args4j.CmdLineException in project ORCID-Source by ORCID.

the class AddScopesToExistingClients method main.

public static void main(String[] args) {
    AddScopesToExistingClients addScopesToExistingClients = new AddScopesToExistingClients();
    CmdLineParser parser = new CmdLineParser(addScopesToExistingClients);
    try {
        parser.parseArgument(args);
        addScopesToExistingClients.validateParameters(parser);
        addScopesToExistingClients.init();
        addScopesToExistingClients.process();
        System.out.println();
        System.out.println();
        System.out.println(addScopesToExistingClients.getClientsUpdated() + " clients were updated");
        System.out.println();
        System.out.println();
    } catch (CmdLineException e) {
        System.err.println(e.getMessage());
        parser.printUsage(System.err);
        System.exit(1);
    }
    System.exit(0);
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) CmdLineException(org.kohsuke.args4j.CmdLineException)

Example 18 with CmdLineException

use of org.kohsuke.args4j.CmdLineException 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);
    }
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) CmdLineException(org.kohsuke.args4j.CmdLineException)

Example 19 with CmdLineException

use of org.kohsuke.args4j.CmdLineException 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);
    }
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) CmdLineException(org.kohsuke.args4j.CmdLineException)

Example 20 with CmdLineException

use of org.kohsuke.args4j.CmdLineException 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);
    }
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) CmdLineException(org.kohsuke.args4j.CmdLineException)

Aggregations

CmdLineException (org.kohsuke.args4j.CmdLineException)100 CmdLineParser (org.kohsuke.args4j.CmdLineParser)75 IOException (java.io.IOException)16 File (java.io.File)14 ArrayList (java.util.ArrayList)11 PrintStream (java.io.PrintStream)7 StringWriter (java.io.StringWriter)6 List (java.util.List)5 FileOutputStream (java.io.FileOutputStream)4 Path (java.nio.file.Path)4 CmdLineParser (com.google.gerrit.util.cli.CmdLineParser)3 FeatureExtractors (io.anserini.ltr.feature.FeatureExtractors)3 Qrels (io.anserini.util.Qrels)3 Directory (org.apache.lucene.store.Directory)3 FSDirectory (org.apache.lucene.store.FSDirectory)3 ConsoleReporter (com.codahale.metrics.ConsoleReporter)2 MetricRegistry (com.codahale.metrics.MetricRegistry)2 Project (com.google.gerrit.reviewdb.client.Project)2 OrmException (com.google.gwtorm.server.OrmException)2 Hudson (hudson.model.Hudson)2