Examples of parseArgument()


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

     * Start and parse the arguments
     */
    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();
      }
View Full Code Here

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

    final Context context = getContextInstance(new HashMap<String,String>());
    CmdLineParser parser = new CmdLineParser(context);
   
    // execute the app
    try {
      parser.parseArgument(args);
     
      // capture start time
      final long startTime = System.currentTimeMillis();
     
      // build the config element
View Full Code Here

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

     */
    public void parseCmdLineArgs(String[] args, CmdLineArgs opts) throws Exception {
      
        CmdLineParser parser = new CmdLineParser(opts);
        try {
            parser.parseArgument(args);
        } 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
View Full Code Here

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

    CmdLineParser cmdLineParser = new CmdLineParser(objWithFlags);
    cmdLineParser.setUsageWidth(100);

    try {
      cmdLineParser.parseArgument(args);

    } catch(CmdLineException cle) {
      exitWithError(cle.getMessage(), cmdLineParser, usagePrefix);
    }
View Full Code Here

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

  private void execMain(String[] args) throws IOException {

    CmdLineParser cmdLineParser = new CmdLineParser(this);
    cmdLineParser.setUsageWidth(100);
    try {
      cmdLineParser.parseArgument(args);

    } catch(CmdLineException cle) {
      System.err.println("\nError: " + cle.getMessage() + "\n\n");
      System.err.println(USAGE_PREFIX);
      cmdLineParser.printUsage(System.err);
View Full Code Here

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

public class Main {
    public static void main(String[] args) throws Exception {
        XTestOptions opts = new XTestOptions();
        CmdLineParser parser = new CmdLineParser(opts);
        try {
            parser.parseArgument(args);
        } catch (Exception e) {
            parser.printUsage(System.err);
            return;
        }
View Full Code Here

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

        final CmdLineOptions opts = new CmdLineOptions();
        CmdLineParser parser = new CmdLineParser(opts);

        // parse command line options, give error message if no arguments passed
        try {
            parser.parseArgument(args);
        } catch (Exception e) {
            parser.printUsage(System.err);
            return;
        }
        if (opts.arguments.isEmpty()) {
View Full Code Here

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

    public static void main(String[] args) throws Exception {
        final CmdLineOptions opts = new CmdLineOptions();
        CmdLineParser parser = new CmdLineParser(opts);
        try {
            parser.parseArgument(args);
        } catch (Exception e) {
            parser.printUsage(System.err);
            return;
        }
        if (opts.arguments.isEmpty()) {
View Full Code Here

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

  public static CommandLineOptions fromCmdLineArgs(String[] args) throws CmdLineException {
    CommandLineOptions options = new CommandLineOptions();
    CmdLineParser parser = new CmdLineParser(options);
    try {
      parser.parseArgument(args);
    } catch (CmdLineException e) {
      System.err.printf("Invalid command line: %s\n\nUsage:\n", e.getMessage());
      parser.setUsageWidth(100);
      parser.printUsage(System.err);
      throw e;
View Full Code Here

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

        // this.line = line;

        CmdLineParser parser = new CmdLineParser(this);

        String[] argsArray = args.toArray(new String[args.size()]);
        parser.parseArgument(argsArray);
    }

    public int runCommand() {
        int exitCode = 0;
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.