Package org.eclipse.jgit.pgm.opt

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


      System.exit(1);
    }
  }

  private void execute(final String[] argv) throws Exception {
    final CmdLineParser clp = new CmdLineParser(this);
    PrintWriter writer = new PrintWriter(System.err);
    try {
      clp.parseArgument(argv);
    } catch (CmdLineException err) {
      if (argv.length > 0 && !help) {
        writer.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage()));
        writer.flush();
        System.exit(1);
      }
    }

    if (argv.length == 0 || help) {
      final String ex = clp.printExample(ExampleMode.ALL, CLIText.get().resourceBundle());
      writer.println("jgit" + ex + " command [ARG ...]");
      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

TOP

Related Classes of org.eclipse.jgit.pgm.opt.CmdLineParser

Copyright © 2018 www.massapicom. 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.