Examples of FlaggedOption


Examples of com.martiansoftware.jsap.FlaggedOption

   @Override
   protected SimpleJSAP buildCommandLineOptions() throws JSAPException {
      return new SimpleJSAP("PiApproximationDemo",
                            "Approximate Pi using Infinispan DistributedExecutorService ", new Parameter[]{
                  new FlaggedOption("configFile", JSAP.STRING_PARSER, "config-samples/distributed-udp.xml",
                                    JSAP.NOT_REQUIRED, 'c', "configFile",
                                    "Infinispan config file"),
                  new FlaggedOption("nodeType", JSAP.STRING_PARSER, "slave", JSAP.REQUIRED,
                                    't', "nodeType", "Node type as either master or slave"),
                  new FlaggedOption("numPoints", JSAP.INTEGER_PARSER,
                                    String.valueOf(DEFAULT_NUM_POINTS), JSAP.REQUIRED, 'n',
                                    "numPoints", "Total number of darts to shoot"),
            });
   }
View Full Code Here

Examples of com.martiansoftware.jsap.FlaggedOption

   * @throws SAXException
   */
  public static void main(String[] args) throws JSAPException {
    SimpleJSAP jsap = new SimpleJSAP("InfinispanFluDemo", "Parse the Influenze data and store in cache ",
        new Parameter[] {
            new FlaggedOption("InfinispanCfg", JSAP.STRING_PARSER, null, JSAP.REQUIRED, 'c',
                JSAP.NO_LONGFLAG, "Location of Infinispan config file"),
            new FlaggedOption("ifile", JSAP.STRING_PARSER, null, JSAP.NOT_REQUIRED, 'i', JSAP.NO_LONGFLAG,
                "Location of influenza.dat"),
            new FlaggedOption("pfile", JSAP.STRING_PARSER, null, JSAP.NOT_REQUIRED, 'p', JSAP.NO_LONGFLAG,
                "location of influenza_aa.dat."),
            new FlaggedOption("count", JSAP.INTEGER_PARSER, "-1", JSAP.NOT_REQUIRED, 'l', JSAP.NO_LONGFLAG,
                "Number of records to load from file"),
            new Switch("query", 'q', "true", "Enable query cli"),
            new Switch("randomquery", 'r', "randomquery",
                "Randomly query the influenza to test that the cache is fully populated"),
            new FlaggedOption("nfile", JSAP.STRING_PARSER, null, JSAP.NOT_REQUIRED, 'n', JSAP.NO_LONGFLAG,
                "Location of influenza_na.dat") });
    if (jsap.messagePrinted())
      System.exit(1);

    JSAPResult config = jsap.parse(args);
View Full Code Here

Examples of com.martiansoftware.jsap.FlaggedOption

 
  @Override
  protected void configureArgsParser(JSAP argsParser) throws JSAPException {
    argsParser.registerParameter(new UnflaggedOption(TARGET_APP_NAME).setRequired(true).setHelp("the application the new library will be created within"));
    argsParser.registerParameter(new UnflaggedOption(NEW_LIBRARY_NAME).setRequired(true).setHelp("the name of the library that will be created"));
    argsParser.registerParameter(new FlaggedOption(LIBRARY_TYPE).setShortFlag('t').setLongFlag("type").setDefault( SupportedLibraryType.br.toString() ));
  }
View Full Code Here

Examples of com.martiansoftware.jsap.FlaggedOption

  }

  @Override
  protected void configureArgsParser(JSAP argsParser) throws JSAPException
  {
    argsParser.registerParameter(new FlaggedOption("port").setShortFlag('p').setLongFlag("port").setRequired(false).setHelp("the port number to run the BRJS application (overrides config)"));
  }
View Full Code Here

Examples of com.martiansoftware.jsap.FlaggedOption

  private Logger logger;
 
  @Override
  protected void configureArgsParser(JSAP argsParser) throws JSAPException {
    argsParser.registerParameter(new UnflaggedOption("app-name").setRequired(true).setHelp("the name of the application to be exported"));
    argsParser.registerParameter(new FlaggedOption("banner").setLongFlag("banner").setRequired(false).setHelp("a banner that will be added to every exported class"));
    argsParser.registerParameter(new FlaggedOption("bannerExtensions").setLongFlag("bannerExtensions").setRequired(false).setDefault("js").setHelp("a comma seperated list of extensions to apply the banner to"));
    argsParser.registerParameter(new UnflaggedOption("target").setRequired(false).setDefault("").setHelp("the target dir for the exported app"));
  }
View Full Code Here

Examples of com.martiansoftware.jsap.FlaggedOption

      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)
      {
        argsParser.registerParameter(new Switch(REPORT_SWITCH).setLongFlag(REPORT_SWITCH).setDefault("false").setHelp("if supplied, generate the HTML reports after running tests"));
      }
View Full Code Here

Examples of com.martiansoftware.jsap.FlaggedOption

    {
      if (addHelpArgument)
        this.registerParameter(new Switch("help", 'h', "help", "Displays this usage information."));

      if (enable_config)
        this.registerParameter(new FlaggedOption("config-file", FileStringParser.getParser().setMustExist(true).setMustBeFile(true), null, false, JSAP.NO_SHORTFLAG, "config-file", "Load configutation options from here."));
    }
    catch (JSAPException e)
    {
      e.printStackTrace();
      System.exit(-1);
View Full Code Here

Examples of com.martiansoftware.jsap.FlaggedOption

  @SuppressWarnings("rawtypes")
  public static void main(String[] args) throws JSAPException
  {
    AppConfig app = new AppConfig("DemoApp", "App to demonstrate yc-config.", true, true);

    app.registerParameter(new FlaggedOption("input-docs", AppConfig.FILE_PARSER.setMustBeFile(true).setMustExist(true), AppConfig.NO_DEFAULT, true, AppConfig.NO_SHORTFLAG, "input-docs", "Read documents from file (space-separated words).").setUsageName("docs-file"));
    app.registerParameter(new FlaggedOption("output", AppConfig.FILE_PARSER.setMustExist(false), "output.sage", false, 'O', "output", "Write SAGE output here (default: output.sage).").setUsageName("sage-file"));
    app.registerParameter(new FlaggedOption("l1-weight", AppConfig.KEYVALUE_PARSER, AppConfig.NO_DEFAULT, false, '1', "l1-weight", "Set L1 regularization weight.").setAllowMultipleDeclarations(true).setUsageName("key=weight"));
    app.registerParameter(new FlaggedOption("iterations", AppConfig.POSITIVE_INTEGER_PARSER, "10", false, 'i', "iterations", "Number of iterations to optimize for (default: infinity).").setUsageName("N"));
    app.registerParameter(new Switch("overwrite", AppConfig.NO_SHORTFLAG, "overwrite", "Overwrite output file?"));

    JSAPResult result = app.parse(args);

    if (!result.success())
View Full Code Here

Examples of com.martiansoftware.jsap.FlaggedOption

   */
  // @@snip:Manual_HelloWorld_6@@
  public static void main(String[] args) throws Exception {
    JSAP jsap = new JSAP();
   
    FlaggedOption opt1 = new FlaggedOption("count")
                .setStringParser(JSAP.INTEGER_PARSER)
                .setDefault("1")
                .setRequired(true)
                .setShortFlag('n')
                .setLongFlag(JSAP.NO_LONGFLAG);
               
    opt1.setHelp("The number of times to say hello.");
    jsap.registerParameter(opt1);
   
    Switch sw1 = new Switch("verbose")
            .setShortFlag('v')
            .setLongFlag("verbose");
View Full Code Here

Examples of com.martiansoftware.jsap.FlaggedOption

   */
  // @@snip:Manual_HelloWorld_8@@
  public static void main(String[] args) throws Exception {
    JSAP jsap = new JSAP();
   
    FlaggedOption opt1 = new FlaggedOption("count")
                .setStringParser(JSAP.INTEGER_PARSER)
                .setDefault("1")
                .setRequired(true)
                .setShortFlag('n')
                .setLongFlag(JSAP.NO_LONGFLAG);

    opt1.setHelp("The number of times to say hello.");
    jsap.registerParameter(opt1);
   
    QualifiedSwitch sw1 = (QualifiedSwitch)
                (new QualifiedSwitch("verbose")
                .setShortFlag('v')
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.