Package com.beust.jcommander

Examples of com.beust.jcommander.JCommander


     * @param args the command line arguments
     */
    public static void main(String[] args) {

        final CommandLineArguments commandLineArguments = new CommandLineArguments();
        final JCommander jCommander = new JCommander(commandLineArguments, args);
        jCommander.setProgramName("graylog2-radio");

        if (commandLineArguments.isShowHelp()) {
            jCommander.usage();
            System.exit(0);
        }

        if (commandLineArguments.isShowVersion()) {
            System.out.println("Graylog2 Radio " + RadioVersion.VERSION);
View Full Code Here


        }
    }

    public static void main(final String[] args) {
        final CommandLineOptions commandLineOptions = new CommandLineOptions();
        final JCommander jCommander = new JCommander(commandLineOptions, args);
        jCommander.setProgramName("graylog2-es-fixup");

        if (commandLineOptions.isDebug()) {
            org.apache.log4j.Logger.getLogger(ESTimestampFixup.class).setLevel(Level.DEBUG);
        } else {
            org.apache.log4j.Logger.getLogger(ESTimestampFixup.class).setLevel(Level.INFO);
        }

        if (commandLineOptions.isHelp()) {
            jCommander.usage();
            System.exit(0);
        }

        if (commandLineOptions.getIndicesArray().length == 0) {
            System.out.println("No indices given. Use '-i graylog2_0 graylog2_1 graylog2_2' command line option.");
            jCommander.usage();
            System.exit(1);
        }

        final JadConfig jadConfig = new JadConfig();
        final Configuration configuration = readConfiguration(jadConfig, commandLineOptions);
View Full Code Here

    public static void main(String[] args) {

        // So jung kommen wir nicht mehr zusammen.

        final CommandLineArguments commandLineArguments = new CommandLineArguments();
        final JCommander jCommander = new JCommander(commandLineArguments, args);
        jCommander.setProgramName("graylog2");

        if (commandLineArguments.isShowHelp()) {
            jCommander.usage();
            System.exit(0);
        }

        if (commandLineArguments.isShowVersion()) {
            System.out.println("Graylog2 Server " + ServerVersion.VERSION);
View Full Code Here

  public static void main(String[] args) {

    // Parse command line arguments

    JCommanderParser jct = new JCommanderParser();
    JCommander jcmdr = new JCommander(jct, args);
   
    if(args == null || args.length == 0 || jct.help){
      jcmdr .usage();
      System.exit(0);
    }

    if (jct.inputFilename == null) {
      System.out.println("ERROR: Need to specify input filename with -i");
View Full Code Here

*/
public class GenerateResourcesMain {

    public static void main(String[] args) {
        ResourceGenerator generator = new ResourceGenerator();
        JCommander jCommander = new JCommander(generator, args);
        if (generator.isHelp()) {
            jCommander.usage();
        } else {
            generator.execute();
        }
    }
View Full Code Here

     */
    public static void main (String[] args) {
        Benchmark.start("main");

        try {
            jc = new JCommander(CommandLineSettings.getSettings(), args);
        } catch (ParameterException e) {
            System.out.println(e.getMessage());
            System.exit(0);
        }

View Full Code Here

    static public TSOServerConfig parseConfig(String args[]){
        TSOServerConfig config = new TSOServerConfig();

        if (args.length == 0) {
            new JCommander(config).usage();
            System.exit(0);
        }

        new JCommander(config, args);

        return config;
    }
View Full Code Here

    MatrixCommand matrix = new MatrixCommand();
    WeaveCommand weave = new WeaveCommand();
    OptimizationCommand optimze = new OptimizationCommand();
    EclipseProcessorCommand eclipse = new EclipseProcessorCommand();
   
    JCommander parser = new JCommander(this);
    parser.addCommand(MatrixCommand.COMMAND, matrix);
    parser.addCommand(WeaveCommand.COMMAND, weave);
    parser.addCommand(OptimizationCommand.COMMAND, optimze);
    parser.addCommand(EclipseProcessorCommand.COMMAND, eclipse);
   
    try {
      parser.setProgramName(getJarName());
      parser.parse(args);
     
      if (help) {
        parser.usage();
        System.exit(0);
      }
     
      String command = parser.getParsedCommand();
      if (MatrixCommand.COMMAND.equals(command)) {
        matrix.execute();
      } else if (WeaveCommand.COMMAND.equals(command)) {
        weave.execute();
      } else if (OptimizationCommand.COMMAND.equals(command)) {
        optimze.execute();
      } else if (EclipseProcessorCommand.COMMAND.equals(command)) {
        eclipse.execute();
      } else {
        parser.usage();
        System.exit(1);
      }
     
    } catch (ParameterException e) {
      System.err.println(e.getMessage());
      System.err.println();
      parser.usage();
    }
  }
View Full Code Here

    boolean help = false;
  }
 
  public static void main(String[] args) {
    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

     * @param args
     */
    public static void main(String[] args) {

        MainArgs mainArgs = new MainArgs();
        JCommander jc = new JCommander(mainArgs);

        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

TOP

Related Classes of com.beust.jcommander.JCommander

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.