Package com.beust.jcommander

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


    {
        final LoadGeneratorCommandLineConfig config = new LoadGeneratorCommandLineConfig();
        JCommander jCommander = new JCommander(config, args);

        if (config.displayUsage) {
            jCommander.usage();
        } else {
            injector = Guice.createInjector(
                    Stage.PRODUCTION,
                    new ConfigurationModule(new ConfigurationFactory(buildConfigMap(config))),
                    new LifeCycleModule(),
View Full Code Here


  public static void main(String[] args1) {
    ArgsEnum args = new ArgsEnum();
    String[] argv = { "-choice", "ONE"};
    JCommander jc = new JCommander(args, argv);
    jc.usage();
    Assert.assertEquals(jc.getParameters().get(0).getDescription(),
        "Options: " + EnumSet.allOf((Class<? extends Enum>) ArgsEnum.ChoiceType.class));
  }

}
View Full Code Here

    {
        final LoadGeneratorCommandLineConfig config = new LoadGeneratorCommandLineConfig();
        JCommander jCommander = new JCommander(config, args);

        if (config.displayUsage) {
            jCommander.usage();
        } else {
            injector = Guice.createInjector(
                    Stage.PRODUCTION,
                    new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    new LifeCycleModule(),
View Full Code Here

        Map<String, JCommander> commands = commander.getCommands();
        String parsedCommand = commander.getParsedCommand();

        if (printHelp) {
            commander.usage();
            return 0;
        }

        if (showVersion) {
            printVersionInfo();
View Full Code Here

            return 0;
        }

        if(parsedCommand == null) {
            infoStream.println("A command must be specified.");
            commander.usage();
            return 1;
        }

        if (verbose) {
            LogUtils.setVerboseLogging();
View Full Code Here

        RoastOptions opt = new RoastOptions();
        JCommander jc = new JCommander(opt, args);
        jc.setProgramName("warmroast");
       
        if (opt.help) {
            jc.usage();
            System.exit(0);
        }

        System.err.println(SEPARATOR);
        System.err.println("WarmRoast");
View Full Code Here

    String command = jc.getParsedCommand();

    if (command == null || params.help) {
      StringBuilder sb = new StringBuilder();
      sb.append("\n");
      jc.usage(sb);

      System.out.println("Version "
          + CramTools.class.getPackage().getImplementationVersion());
      System.out.println(sb.toString());
      return;
View Full Code Here

        Assert.assertEquals(hidden.interactive.booleanValue(), true);
        Assert.assertEquals(hidden.patterns, Arrays.asList("A.java"));

        jc.setProgramName("TestCommander");
        StringBuilder out = new StringBuilder();
        jc.usage(out);

        Assert.assertTrue(out.toString().contains("add      Add file contents to the index"));
        Assert.assertFalse(out.toString().contains("hidden      Hidden command to add file contents to the index"));
    }
View Full Code Here

    CommandMain cm = new CommandMain();
    JCommander jc = new JCommander(cm);
    CommandCommit commit = new CommandCommit();
    jc.addCommand("commit", commit, "ci", "cmt");
    StringBuilder out = new StringBuilder();
    jc.usage("commit", out);
    patternMatchesTimes("commit\\(ci,cmt\\)", out.toString(), 1);

    out = new StringBuilder();
    jc.usage("ci", out);
    patternMatchesTimes("commit\\(ci,cmt\\)", out.toString(), 1);
View Full Code Here

    StringBuilder out = new StringBuilder();
    jc.usage("commit", out);
    patternMatchesTimes("commit\\(ci,cmt\\)", out.toString(), 1);

    out = new StringBuilder();
    jc.usage("ci", out);
    patternMatchesTimes("commit\\(ci,cmt\\)", out.toString(), 1);

    out = new StringBuilder();
    jc.usage("cmt", out);
    patternMatchesTimes("commit\\(ci,cmt\\)", out.toString(), 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.