Examples of CmdLineParser


Examples of org.eclipse.jgit.pgm.opt.CmdLineParser

     *          the error stream, may be null in which case the system error stream will be used
     * @throws Exception
     *          if an error occurs
     */
    public void execute(final String[] argv, InputStream in, OutputStream out, OutputStream err) throws Exception {
        final CmdLineParser clp = new CmdLineParser(this);
        PrintWriter writer = new PrintWriter(err != null ? err : System.err);
        try {
            clp.parseArgument(argv);
        } catch (CmdLineException e) {
            if (argv.length > 0 && !help) {
                writer.println(MessageFormat.format(CLIText.get().fatalError, e.getMessage()));
                writer.flush();
                throw new Die(true);
            }
        }

        if (argv.length == 0 || help) {
            final String ex = clp.printExample(ExampleMode.ALL, CLIText.get().resourceBundle());
            writer.println("jgit" + ex + " command [ARG ...]"); //$NON-NLS-1$
            if (help) {
                writer.println();
                clp.printUsage(writer, CLIText.get().resourceBundle());
                writer.println();
            } else if (subcommand == null) {
                writer.println();
                writer.println(CLIText.get().mostCommonlyUsedCommandsAre);
                final CommandRef[] common = CommandCatalog.common();
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

        }
        System.exit(0);
    }

    public void run(String[] args) throws XQueryException {
        CmdLineParser parser = new CmdLineParser(this);
        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            System.err.println(e.getMessage());
            showHelp();
            return;
        }
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

            LOG.error("Command failed: " + Arrays.toString(args) + "\nelasped " + sw);
        }
    }

    private void prepArgs(String[] args) {
        CmdLineParser parser = new CmdLineParser(this);
        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            LOG.error(e.getMessage());
            return;
        }
    }
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

   */
  private static class CommandLine {
    private final CmdLineParser parser;

    private CommandLine(String[] args) throws CmdLineException {
      parser = new CmdLineParser(this);
      parser.parseArgument(args);
    }
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

        }
    }

    private static Options parseOptions(String[] args) {
        Options opts = new Options();
        CmdLineParser parser = new CmdLineParser(opts);
        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            e.printStackTrace(System.err);
            parser.printUsage(System.err);
            System.exit(1);
        }
        return opts;
    }
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

        return bootstrap;
    }

    private static Options parseOptions(String[] args) {
        Options opts = new Options();
        CmdLineParser parser = new CmdLineParser(opts);
        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            e.printStackTrace(System.err);
            parser.printUsage(System.err);
            System.exit(1);
        }
        return opts;
    }
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

        return Hazelcast.newHazelcastInstance(config);
    }

    private static Options parseOptions(String[] args) {
        Options opts = new Options();
        CmdLineParser parser = new CmdLineParser(opts);
        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            e.printStackTrace(System.err);
            parser.printUsage(System.err);
            System.exit(1);
        }
        if (opts.hosts == null) {
            parser.printUsage(System.err);
            System.exit(1);
        }
        return opts;
    }
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

        }
    }

    public static void main(String[] args) {
        DemoStatusToolOptions options = new DemoStatusToolOptions();
        CmdLineParser parser = new CmdLineParser(options);
       
        try {
            parser.parseArgument(args);
        } catch(CmdLineException e) {
            System.err.println(e.getMessage());
            printUsageAndExit(parser);
        }
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser


    @SuppressWarnings("rawtypes")
    public static void main(String[] args) {
        DemoCrawlToolOptions options = new DemoCrawlToolOptions();
        CmdLineParser parser = new CmdLineParser(options);

        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            System.err.println(e.getMessage());
            printUsageAndExit(parser);
        }
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

   * @param args
   */
  @SuppressWarnings("rawtypes")
    public static void main(String[] args) {
    AnalyzeEmailOptions options = new AnalyzeEmailOptions();
        CmdLineParser parser = new CmdLineParser(options);
       
        try {
            parser.parseArgument(args);
        } catch(CmdLineException e) {
            System.err.println(e.getMessage());
            printUsageAndExit(parser);
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.