Package org.kohsuke.args4j

Examples of org.kohsuke.args4j.CmdLineParser.printUsage()


      // an error message.
      System.err.println(e.getMessage());
      _help = true;
    }
    if(_help) {
      parser.printUsage(System.err);
      System.err.println();
      return;
    }
    if (_numWorkers <= 0) {
      throw new IllegalArgumentException("Need at least one worker");
View Full Code Here


        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            System.err.println(e.getMessage());
            System.err.println("java " + this.getClass() + " [options...]");
            parser.printUsage(System.err);
            System.err.println();
            return false;
        }
        return true;
    }
View Full Code Here

        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            System.err.println(e.getMessage());
            System.err.println("java " + this.getClass() + " [options...]");
            parser.printUsage(System.err);
            System.err.println();
            System.exit(-1);
        }
    }
View Full Code Here

  private void doMain(String[] args) throws Exception {
    CmdLineParser parser = new CmdLineParser(this);
    parser.parseArgument(args);
    if (displayHelp) {
      CmdLineParser p = new CmdLineParser(this);
      p.printUsage(System.out);
      return;
    }
    Preconditions.checkArgument(
        !inputs.isEmpty(), "At least one input must be provided in the --inputs flag.");
    Preconditions.checkArgument(
View Full Code Here

    try {
      parser.parseArgument(args);
    } catch (CmdLineException e) {
      // handling of wrong arguments
      System.err.println(e.getMessage());
      parser.printUsage(System.err);
      System.exit(1);
    }
    driver.run();
    System.exit(0);
  }
View Full Code Here

    }

    private void printUsage(PrintStream ps) {
      CmdLineParser p = new CmdLineParser(this);
      p.printUsage(new OutputStreamWriter(ps), null, OptionHandlerFilter.ALL);
      ps.flush();
    }

    private void printShortUsageAfterErrors(PrintStream ps) {
      ps.print("Sample usage: ");
View Full Code Here

    final StartConsole bean = new StartConsole();
    final CmdLineParser parser = new CmdLineParser(bean);
    try {
      parser.parseArgument(args);
      if (bean.showHelp) {
        parser.printUsage(System.out);
      } else {
        bean.run();
      }
      System.out.println("Ending program.");
    } catch (final CmdLineException e) {
View Full Code Here

      }
      System.out.println("Ending program.");
    } catch (final CmdLineException e) {
      /* handling of wrong arguments */
      System.err.println(e.getMessage());
      parser.printUsage(System.err);
    }
    System.exit(0);
  }


 
View Full Code Here

      // print usage information
      System.err.println(e.getMessage());
      System.err.print("java -jar jmxeval.jar ");
      parser.printSingleLineUsage(System.err);
      System.err.println();
      parser.printUsage(System.err);
      returnValue = Status.UNKNOWN.getValue();
    }
   
    return returnValue;
  }
View Full Code Here

        } catch (CmdLineException e) {
            System.err.println(e.getMessage());
            System.err.println("java -jar jee2pctest-client.jar [options...]");
            System.err.println("   container.properties expected in the current working dir. ");
            // print the list of available options
            parser.printUsage(System.err);
            System.err.println();
            System.exit(1);
        }
    }
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.