Package com.martiansoftware.jsap

Examples of com.martiansoftware.jsap.UnflaggedOption


    JSAP argsParser = new JSAP();
    try
    {
      if (mode == RunMode.RUN_TESTS)
      {
        argsParser.registerParameter(new UnflaggedOption("dir").setRequired(true).setHelp("the directory from which to start looking for tests"));
        argsParser.registerParameter(new UnflaggedOption("testType").setDefault("UTsAndATs").setStringParser(EnumeratedStringParser.getParser("UTs;ATs;ITs;UTsAndATs;ALL;", true)).setHelp("(UTs|ATs|ITs|ALL)"));
      }
      argsParser.registerParameter(new FlaggedOption("browsers").setShortFlag('b').setList(true).setListSeparator(',').setHelp("you can use ALL to specify that the tests should be run on all browsers"));
      // this isnt in the if block above so it appears as the last option in the help menu
      if (mode == RunMode.RUN_TESTS)
      {
View Full Code Here


  private BRJS brjs;
  private Logger logger;
 
  @Override
  protected void configureArgsParser(JSAP argsParser) throws JSAPException {
    argsParser.registerParameter(new UnflaggedOption("app-name").setRequired(true).setHelp("the application to show dependencies for"));
    argsParser.registerParameter(new UnflaggedOption("require-path").setRequired(true).setHelp("the source module to show dependencies for"));
    argsParser.registerParameter(new UnflaggedOption("aspect-name").setDefault("default").setHelp("the aspect to show dependencies for"));
    argsParser.registerParameter(new Switch("prefix").setShortFlag('p').setLongFlag("prefix").setDefault("false").setHelp("display dependencies for all source modules starting with the given require path"));
    argsParser.registerParameter(new Switch("alias").setShortFlag('a').setLongFlag("alias").setDefault("false").setHelp("display dependencies for an alias rather than a require path"));
    argsParser.registerParameter(new Switch("all").setShortFlag('A').setLongFlag("all").setDefault("false").setHelp("show all ocurrences of a dependency"));
  }
View Full Code Here

    /**
     * Returns an UnflaggedOption configured according to this configuration.
     * @return an UnflaggedOption configured according to this configuration.
     */
    public Parameter getParameter() {
        UnflaggedOption result = new UnflaggedOption(this.getId());

        result.setRequired(this.getRequired());
        result.setList(this.getIslist());
        if (this.declaredListSeparator()) {
            result.setListSeparator(this.getListseparator());
        }
        result.setGreedy(this.getGreedy());
        result.setDefault(this.getDefaults());
        setupStringParser(result);
        return (result);
    }
View Full Code Here

            .setShortFlag('v')
            .setLongFlag("verbose");
    sw1.setHelp("Requests verbose output.");
    jsap.registerParameter(sw1);
   
    UnflaggedOption opt2 = new UnflaggedOption("name")
                .setStringParser(JSAP.STRING_PARSER)
                .setDefault("World")
                .setRequired(true)
                .setGreedy(true);
   
    opt2.setHelp("One or more names of people you would like to greet.");
    jsap.registerParameter(opt2);
   
    JSAPResult config = jsap.parse(args)

    if (!config.success()) {
View Full Code Here

                    JSAP.NO_DEFAULT,
                    JSAP.NOT_REQUIRED,
                    'f',
                    "flagged"));
            jsap.registerParameter(
                new UnflaggedOption(
                    "testunflagged",
                    StringStringParser.getParser(),
                    JSAP.NO_DEFAULT,
                    JSAP.NOT_REQUIRED,
                    JSAP.NOT_GREEDY));
View Full Code Here

                .setListSeparator(','));
   
    sw1.setHelp("Requests verbose output.");
    jsap.registerParameter(sw1);
   
    UnflaggedOption opt2 = new UnflaggedOption("name")
                .setStringParser(JSAP.STRING_PARSER)
                .setDefault("World")
                .setRequired(true)
                .setGreedy(true);
   
    opt2.setHelp("One or more names of people you would like to greet.");
    jsap.registerParameter(opt2);
   
    JSAPResult config = jsap.parse(args)

    if (!config.success()) {
View Full Code Here

        FlaggedOption f1 = new FlaggedOption("myflagged");
        f1.setShortFlag('f').setLongFlag("flagged").setRequired(true).setHelp(
            "do flagged stuff");
        jsap.registerParameter(f1);

        UnflaggedOption f2 = new UnflaggedOption("myunflagged");
        f2.setGreedy(JSAP.GREEDY).setHelp("input files");
        jsap.registerParameter(f2);

        Switch sw1 = new Switch("myswitch");
        sw1.setLongFlag("verbose").setHelp(
            "display extra logging information.");
View Full Code Here

    // Create an unflagged option called "names" that we'll use to
    // say hello to particular people.
    // To make it more interesting, we'll make it "greedy", so
    // it consumes all remaining unflagged tokens on the command line
    // as multiple values
    UnflaggedOption opt2 = new UnflaggedOption("name")
                .setStringParser(JSAP.STRING_PARSER)
                .setDefault("World")
                .setRequired(false)
                .setGreedy(true);
View Full Code Here

      new Parameter[] {
        new FlaggedOption( "count", JSAP.INTEGER_PARSER, "1", JSAP.REQUIRED, 'n', JSAP.NO_LONGFLAG,
          "The number of times to say hello." ),
        new QualifiedSwitch( "verbose", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'v', "verbose",
          "Requests verbose output." ).setList( true ).setListSeparator( ',' ),
        new UnflaggedOption( "name", JSAP.STRING_PARSER, "World", JSAP.REQUIRED, JSAP.GREEDY,
          "One or more names of people you would like to greet." )
      }
    );
   
    JSAPResult config = jsap.parse(args)
View Full Code Here

            .setShortFlag('v')
            .setLongFlag("verbose");
   
    jsap.registerParameter(sw1);
   
    UnflaggedOption opt2 = new UnflaggedOption("name")
                .setStringParser(JSAP.STRING_PARSER)
                .setDefault("World")
                .setRequired(true)
                .setGreedy(true);
               
View Full Code Here

TOP

Related Classes of com.martiansoftware.jsap.UnflaggedOption

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.