Examples of usage()


Examples of com.beust.jcommander.JCommander.usage()

        try {
            jc.parse(args);
        } catch (Exception e) {
            JCommander.getConsole().println("Cannot parse arguments: " + e.getMessage());
            jc.usage();
            System.exit(1);
        }

        startNode(mainArgs);
    }
View Full Code Here

Examples of com.beust.jcommander.JCommander.usage()

      commander.addObject(other);
    commander.setProgramName(programName);
    try {
      commander.parse(args);
    } catch (ParameterException ex) {
      commander.usage();
      exitWithError(ex.getMessage(), 1);
    }
    if (help) {
      commander.usage();
      exit(0);
View Full Code Here

Examples of com.beust.jcommander.JCommander.usage()

    } catch (ParameterException ex) {
      commander.usage();
      exitWithError(ex.getMessage(), 1);
    }
    if (help) {
      commander.usage();
      exit(0);
    }
  }
 
  public void exit(int status) {
View Full Code Here

Examples of com.beust.jcommander.JCommander.usage()

    jc.addCommand("fail", new FailOpts());
    jc.addCommand("delete", new DeleteOpts());
    jc.addCommand("print", new PrintOpts());
    jc.parse(args);
    if (opts.help || jc.getParsedCommand() == null) {
      jc.usage();
      System.exit(-1);
    }

    AdminUtil<Master> admin = new AdminUtil<Master>();
View Full Code Here

Examples of com.beust.jcommander.JCommander.usage()

        JCommander jc = new JCommander(jcArgs);
        try {
            if (Sets.newHashSet(cliArgs).contains("-help")) {
                Parameters parametersAnnotation = jcArgs.getClass().getAnnotation(Parameters.class);
                jc.addCommand(parametersAnnotation.commandNames()[0], jcArgs);
                jc.usage(parametersAnnotation.commandNames()[0]);
                System.exit(0);
            }
            jc.parse(cliArgs);
        } catch (Exception e) {
            JCommander.getConsole().println("Cannot parse arguments: " + e.getClass() + " -> " + e.getMessage());
View Full Code Here

Examples of com.beust.jcommander.JCommander.usage()

                System.exit(0);
            }
            jc.parse(cliArgs);
        } catch (Exception e) {
            JCommander.getConsole().println("Cannot parse arguments: " + e.getClass() + " -> " + e.getMessage());
            jc.usage();
            System.exit(1);
        }
        return jc;
    }
View Full Code Here

Examples of com.beust.jcommander.JCommander.usage()

    Opts opts = new Opts();
    JCommander jc = new JCommander(opts);
    jc.setProgramName(NativeMapConcurrencyTest.class.getName());
    jc.parse(args);
    if (opts.help) {
      jc.usage();
      return;
    }
    NativeMap nm = create(opts.rows, opts.cols);
    runTest(nm, opts.rows, opts.cols, opts.threads, opts.writeThreads);
    nm.delete();
View Full Code Here

Examples of com.beust.jcommander.JCommander.usage()

    StopAllCommand stopAllOpts = new StopAllCommand();
    cl.addCommand("stopAll", stopAllOpts);
    cl.parse(args);
   
    if (opts.help || cl.getParsedCommand() == null) {
      cl.usage();
      return;
    }
    Instance instance = opts.getInstance();
     
    try {
View Full Code Here

Examples of com.beust.jcommander.JCommander.usage()

    jc.addCommand("fail", new FailOpts());
    jc.addCommand("delete", new DeleteOpts());
    jc.addCommand("print", new PrintOpts());
    jc.parse(args);
    if (opts.help || jc.getParsedCommand() == null) {
      jc.usage();
      System.exit(-1);
    }
   
    AdminUtil<Master> admin = new AdminUtil<Master>();
   
View Full Code Here

Examples of com.cloud.api.Implementation.usage()

            } else {
              System.out.println("Command " + apiCommand.getName() + " misses description");
            }

           
            String commandUsage = impl.usage();
            if (commandUsage != null && !commandUsage.isEmpty()) {
              apiCommand.setUsage(commandUsage);
            }
           
            //Set version when the API is added
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.