Package com.martiansoftware.jsap

Examples of com.martiansoftware.jsap.Switch


  @Override
  protected void configureArgsParser(JSAP argsParser) throws JSAPException {
    argsParser.registerParameter(new UnflaggedOption("app-name").setRequired(true).setHelp("the application containing the workbench to show dependencies for"));
    argsParser.registerParameter(new UnflaggedOption("bladeset-name").setRequired(true).setHelp("the bladeset containing the workbench to show dependencies for"));
    argsParser.registerParameter(new UnflaggedOption("blade-name").setRequired(true).setHelp("the blade containing the workbench to show dependencies for"));
    argsParser.registerParameter(new Switch("all").setShortFlag('A').setLongFlag("all").setDefault("false").setHelp("show all ocurrences of a dependency"));
  }
View Full Code Here


  }
 
  @Override
  protected void configureArgsParser(JSAP argsParser) throws JSAPException {
    argsParser.registerParameter(new UnflaggedOption("app-name").setRequired(true).setHelp("the application for which jsdoc will be generated"));
    argsParser.registerParameter(new Switch("verbose-flag").setShortFlag('v').setLongFlag("verbose").setDefault("false").setHelp("display more console output while generating the jsdoc output"));
  }
View Full Code Here

      }
      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"));
      }
      if (mode == RunMode.RUN_SERVER)
      {
        argsParser.registerParameter(new Switch(NO_BROWSER_SWITCH).setLongFlag(NO_BROWSER_SWITCH).setDefault("false").setHelp("you can start the test-server on it's own without a browser"));
      }
    }
    catch (Exception ex)
    {
      throw new CommandOperationException("Error initialising configuration.", ex);
View Full Code Here

  @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

  private void init(boolean addHelpArgument)
  {
    try
    {
      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)
View Full Code Here

    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

    /**
     * Returns a Switch configured according to this configuration.
     * @return a Switch configured according to this configuration.
     */
    public Parameter getParameter() {
        Switch result = new Switch(this.getId());
        result.setShortFlag(this.getShortflag());
        result.setLongFlag(this.getLongflag());
        result.setDefault(this.getDefaults());
        return (result);
    }
View Full Code Here

                .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");
    sw1.setHelp("Requests verbose output.");
    jsap.registerParameter(sw1);
   
    UnflaggedOption opt2 = new UnflaggedOption("name")
                .setStringParser(JSAP.STRING_PARSER)
                .setDefault("World")
View Full Code Here

                    "testunflagged",
                    StringStringParser.getParser(),
                    JSAP.NO_DEFAULT,
                    JSAP.NOT_REQUIRED,
                    JSAP.NOT_GREEDY));
            jsap.registerParameter(new Switch("testswitch", 's', "switch"));
        } catch (Throwable t) {
            fail(t.getMessage());
        }

        Properties p = new Properties();
View Full Code Here

        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.");
        jsap.registerParameter(sw1);

        System.out.println("Usage: Example1 " + jsap.getUsage());
        System.out.println(jsap.getHelp());
View Full Code Here

TOP

Related Classes of com.martiansoftware.jsap.Switch

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.