Package joptsimple

Examples of joptsimple.OptionSpec


  protected ClusterSpec getClusterSpec(OptionSet optionSet) throws ConfigurationException {
    Configuration optionsConfig = new PropertiesConfiguration();
    for (Map.Entry<Property, OptionSpec> entry : optionSpecs.entrySet()) {
      Property property = entry.getKey();
      OptionSpec option = entry.getValue();
      if (property.hasMultipleArguments()) {
        optionsConfig.setProperty(property.getConfigName(),
            optionSet.valuesOf(option));
      } else {
        optionsConfig.setProperty(property.getConfigName(),
View Full Code Here


 
  protected ClusterSpec getClusterSpec(OptionSet optionSet) throws ConfigurationException {
    Configuration optionsConfig = new PropertiesConfiguration();
    for (Map.Entry<Property, OptionSpec> entry : optionSpecs.entrySet()) {
      Property property = entry.getKey();
      OptionSpec option = entry.getValue();
      if (property.hasMultipleArguments()) {
        optionsConfig.setProperty(property.getConfigName(),
            optionSet.valuesOf(option));
      } else {
        optionsConfig.setProperty(property.getConfigName(),
View Full Code Here

  protected ClusterSpec getClusterSpec(OptionSet optionSet) throws ConfigurationException {
    Configuration optionsConfig = new PropertiesConfiguration();
    for (Map.Entry<Property, OptionSpec> entry : optionSpecs.entrySet()) {
      Property property = entry.getKey();
      OptionSpec option = entry.getValue();
      if (property.hasMultipleArguments()) {
        optionsConfig.setProperty(property.getConfigName(),
            optionSet.valuesOf(option));
      } else {
        optionsConfig.setProperty(property.getConfigName(),
View Full Code Here

        OptionParser parser =  new OptionParser();
        OptionSpec<String> zkOption = parser
                .acceptsAll(Lists.newArrayList("z"), "ZooKeeper connection string, defaults to localhost")
                .withRequiredArg().ofType(String.class)
                .defaultsTo("localhost");
        OptionSpec verboseOption = parser
                .acceptsAll(Lists.newArrayList("verbose"), "Enable debug logging");
       
        OptionSpec<Integer> hbaseMasterPortOption = parser
                .acceptsAll(ImmutableList.of("hbase-master-port"), "HBase Master web ui port number")
                .withRequiredArg().ofType(Integer.class)
View Full Code Here

    public void run(String[] args) throws Exception {
        LogManager.resetConfiguration();
        PropertyConfigurator.configure(getClass().getResource("log4j.properties"));

        OptionParser parser =  new OptionParser();
        OptionSpec enableJmxOption = parser.accepts("enable-jmx",
                "use JMX to retrieve info from HBase regionservers (port " + ReplicationStatusRetriever.HBASE_JMX_PORT + ")");
        OptionSpec<String> zkOption = parser
                .acceptsAll(ImmutableList.of("z"), "ZooKeeper connection string, defaults to localhost")
                .withRequiredArg().ofType(String.class)
                .defaultsTo("localhost");
View Full Code Here

                .accepts("storage", "Index storage enabled").withOptionalArg()
                .ofType(Boolean.class);
        OptionSpec<File> csvFile =
                parser.accepts("csvFile", "File to write a CSV version of the benchmark data.")
                        .withOptionalArg().ofType(File.class);
        OptionSpec help = parser.acceptsAll(asList("h", "?", "help"), "show help").forHelp();
        OptionSpec<String> nonOption = parser.nonOptions();

        OptionSet options = parser.parse(args);

        if (options.has(help)) {
View Full Code Here

        OptionSpec<Boolean> flatStructure = parser.accepts("flatStructure", "Whether the test should use a flat structure or not.")
                .withOptionalArg().ofType(Boolean.class).defaultsTo(Boolean.FALSE);
        OptionSpec<Integer> numberOfUsers = parser.accepts("numberOfUsers")
                .withOptionalArg().ofType(Integer.class).defaultsTo(10000);
        OptionSpec<String> nonOption = parser.nonOptions();
        OptionSpec help = parser.acceptsAll(asList("h", "?", "help"), "show help").forHelp();
        OptionSet options = parser.parse(args);

        if(options.has(help)){
            parser.printHelpOn(System.out);
            System.exit(0);
View Full Code Here

    public static void main(String[] args) throws Exception {
        OptionParser parser = new OptionParser();
        OptionSpec<Integer> clusterId = parser.accepts("clusterId", "MongoMK clusterId")
                .withRequiredArg().ofType(Integer.class).defaultsTo(0);
        OptionSpec quiet = parser.accepts("quiet", "be less chatty");
        OptionSpec shell = parser.accepts("shell", "run the shell after executing files");
        OptionSpec help = parser.acceptsAll(asList("h", "?", "help"), "show help").forHelp();
        OptionSpec<String> nonOption = parser.nonOptions("console {<path-to-repository> | <mongodb-uri>}");

        OptionSet options = parser.parse(args);
        List<String> nonOptions = nonOption.values(options);
View Full Code Here

TOP

Related Classes of joptsimple.OptionSpec

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.