Search in sources :

Example 1 with CommandLineParser

use of org.apache.ivy.util.cli.CommandLineParser in project ant-ivy by apache.

the class Main method run.

private static ResolveReport run(String[] args, boolean isCli) throws Exception {
    CommandLineParser parser = getParser();
    // parse the command line arguments
    CommandLine line;
    try {
        line = parser.parse(args);
    } catch (ParseException pe) {
        // display usage and and rethrow
        usage(parser, false);
        throw new ParseException(pe.getMessage());
    }
    if (line.hasOption("?")) {
        usage(parser, line.hasOption("deprecated"));
        return null;
    }
    return run(line, isCli);
}
Also used : CommandLine(org.apache.ivy.util.cli.CommandLine) CommandLineParser(org.apache.ivy.util.cli.CommandLineParser) ParseException(org.apache.ivy.util.cli.ParseException)

Aggregations

CommandLine (org.apache.ivy.util.cli.CommandLine)1 CommandLineParser (org.apache.ivy.util.cli.CommandLineParser)1 ParseException (org.apache.ivy.util.cli.ParseException)1