Example usage for org.apache.commons.cli OptionBuilder withArgName

List of usage examples for org.apache.commons.cli OptionBuilder withArgName

Introduction

In this page you can find the example usage for org.apache.commons.cli OptionBuilder withArgName.

Prototype

public static OptionBuilder withArgName(String name) 

Source Link

Document

The next Option created will have the specified argument value name.

Usage

From source file:esg.node.security.shell.cmds.ESGFshow.java

public void doInitOptions() {

    getOptions().addOption("v", "verbose", false, "show more verbose output");
    getOptions().addOption("d", "details", false, "show details");
    getOptions().addOption("all", false, "show all details");

    getOptions().addOption("au", "all-users", false, "show all users on the system");
    getOptions().addOption("ag", "all-groups", false, "show all groups on the system");
    getOptions().addOption("ar", "all-roles", false, "show all roles on the system");

    Option user = OptionBuilder.withArgName("user").hasArg(true).withDescription("User to inspect")
            .withLongOpt("user").create("u");
    getOptions().addOption(user);/*from w w w . j a va2s  .  c o  m*/

    Option group = OptionBuilder.withArgName("group").hasArg(true).withDescription("Group to inspect")
            .withLongOpt("group").create("g");
    getOptions().addOption(group);

    Option role = OptionBuilder.withArgName("role").hasArg(true).withDescription("Group to inspect")
            .withLongOpt("role").create("r");
    getOptions().addOption(role);

    //---------

    Option usersInGroup = OptionBuilder.withArgName("group").hasArg(true)
            .withDescription("shows all the users in the given group").withLongOpt("users_in_group")
            .create("uig");
    getOptions().addOption(usersInGroup);

    Option usersInRole = OptionBuilder.withArgName("role").hasArg(true)
            .withDescription("shows all the users in the given role").withLongOpt("users_in_role")
            .create("uir");
    getOptions().addOption(usersInRole);

    //---------

}

From source file:edu.umd.windmemory.BuildInvertedIndexCompressed.java

/**
 * Runs this tool.//  www  . j a  v  a  2s  . co  m
 */
@SuppressWarnings({ "static-access" })
public int run(String[] args) throws Exception {
    Options options = new Options();

    options.addOption(OptionBuilder.withArgName("path").hasArg().withDescription("input path").create(INPUT));
    options.addOption(OptionBuilder.withArgName("path").hasArg().withDescription("output path").create(OUTPUT));
    options.addOption(OptionBuilder.withArgName("num").hasArg().withDescription("number of reducers")
            .create(NUM_REDUCERS));

    CommandLine cmdline;
    CommandLineParser parser = new GnuParser();

    try {
        cmdline = parser.parse(options, args);
    } catch (ParseException exp) {
        System.err.println("Error parsing command line: " + exp.getMessage());
        return -1;
    }

    if (!cmdline.hasOption(INPUT) || !cmdline.hasOption(OUTPUT)) {
        System.out.println("args: " + Arrays.toString(args));
        HelpFormatter formatter = new HelpFormatter();
        formatter.setWidth(120);
        formatter.printHelp(this.getClass().getName(), options);
        ToolRunner.printGenericCommandUsage(System.out);
        return -1;
    }

    String inputPath = cmdline.getOptionValue(INPUT);
    String outputPath = cmdline.getOptionValue(OUTPUT);
    int reduceTasks = cmdline.hasOption(NUM_REDUCERS) ? Integer.parseInt(cmdline.getOptionValue(NUM_REDUCERS))
            : 1;

    LOG.info("Tool name: " + BuildInvertedIndexCompressed.class.getSimpleName());
    LOG.info(" - input path: " + inputPath);
    LOG.info(" - output path: " + outputPath);
    LOG.info(" - num reducers: " + reduceTasks);

    Job job = Job.getInstance(getConf());
    job.setJobName(BuildInvertedIndexCompressed.class.getSimpleName());
    job.setJarByClass(BuildInvertedIndexCompressed.class);

    job.setNumReduceTasks(reduceTasks);

    FileInputFormat.setInputPaths(job, new Path(inputPath));
    FileOutputFormat.setOutputPath(job, new Path(outputPath));

    job.setMapOutputKeyClass(PairOfStrings.class);
    job.setMapOutputValueClass(IntWritable.class);
    // job.setOutputKeyClass(PairOfStrings.class);
    // job.setOutputValueClass(IntWritable.class);
    job.setOutputKeyClass(Text.class);
    job.setOutputValueClass(ArrayListWritable.class);
    job.setOutputFormatClass(MapFileOutputFormat.class);

    job.setMapperClass(MyMapper.class);
    job.setPartitionerClass(MyPartitioner.class);
    job.setReducerClass(MyReducer.class);

    // Delete the output directory if it exists already.
    Path outputDir = new Path(outputPath);
    FileSystem.get(getConf()).delete(outputDir, true);

    long startTime = System.currentTimeMillis();
    job.waitForCompletion(true);
    System.out.println("Job Finished in " + (System.currentTimeMillis() - startTime) / 1000.0 + " seconds");

    return 0;
}

From source file:com.yahoo.semsearch.fastlinking.io.WikipediaDocnoMappingBuilder.java

@SuppressWarnings("static-access")
@Override// w  w  w  .  j av a2s .c  o  m
public int run(String[] args) throws Exception {
    Options options = new Options();
    options.addOption(
            OptionBuilder.withArgName("path").hasArg().withDescription("XML dump file").create(INPUT_OPTION));
    options.addOption(OptionBuilder.withArgName("path").hasArg().withDescription("output file")
            .create(OUTPUT_FILE_OPTION));
    options.addOption(OptionBuilder.withArgName("en|sv|de|cs|es|zh|ar|tr|it").hasArg()
            .withDescription("two-letter language code").create(LANGUAGE_OPTION));
    options.addOption(KEEP_ALL_OPTION, false, "keep all pages");

    CommandLine cmdline;
    CommandLineParser parser = new GnuParser();
    try {
        cmdline = parser.parse(options, args);
    } catch (ParseException exp) {
        System.err.println("Error parsing command line: " + exp.getMessage());
        return -1;
    }

    if (!cmdline.hasOption(INPUT_OPTION) || !cmdline.hasOption(OUTPUT_FILE_OPTION)) {
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp(this.getClass().getName(), options);
        ToolRunner.printGenericCommandUsage(System.out);
        return -1;
    }

    String language = null;
    if (cmdline.hasOption(LANGUAGE_OPTION)) {
        language = cmdline.getOptionValue(LANGUAGE_OPTION);
        if (language.length() != 2) {
            System.err.println("Error: \"" + language + "\" unknown language!");
            return -1;
        }
    }

    String inputPath = cmdline.getOptionValue(INPUT_OPTION);
    String outputFile = cmdline.getOptionValue(OUTPUT_FILE_OPTION);
    boolean keepAll = cmdline.hasOption(KEEP_ALL_OPTION);

    String tmpPath = "tmp-" + WikipediaDocnoMappingBuilder.class.getSimpleName() + "-" + RANDOM.nextInt(10000);

    LOG.info("Tool name: " + this.getClass().getName());
    LOG.info(" - input: " + inputPath);
    LOG.info(" - output file: " + outputFile);
    LOG.info(" - keep all pages: " + keepAll);
    LOG.info(" - language: " + language);

    Job job = Job.getInstance(getConf());
    job.setJarByClass(WikipediaDocnoMappingBuilder.class);
    job.setJobName(String.format("BuildWikipediaDocnoMapping[%s: %s, %s: %s, %s: %s]", INPUT_OPTION, inputPath,
            OUTPUT_FILE_OPTION, outputFile, LANGUAGE_OPTION, language));

    job.getConfiguration().setBoolean(KEEP_ALL_OPTION, keepAll);
    if (language != null) {
        job.getConfiguration().set("wiki.language", language);
    }
    job.setNumReduceTasks(1);

    FileInputFormat.setInputPaths(job, new Path(inputPath));
    FileOutputFormat.setOutputPath(job, new Path(tmpPath));
    FileOutputFormat.setCompressOutput(job, false);

    job.setOutputKeyClass(IntWritable.class);
    job.setOutputValueClass(IntWritable.class);
    job.setInputFormatClass(WikipediaPageInputFormat.class);
    job.setOutputFormatClass(TextOutputFormat.class);

    job.setMapperClass(MyMapper.class);
    job.setReducerClass(MyReducer.class);

    // Delete the output directory if it exists already.
    FileSystem.get(getConf()).delete(new Path(tmpPath), true);

    if (job.waitForCompletion(true)) {

        //         long cnt = keepAll ? job.getCounters().findCounter(PageTypes.TOTAL).getValue() : job.getCounters().findCounter(PageTypes.ARTICLE).getValue();
        long cnt = job.getCounters()
                .findCounter("org.apache.hadoop.mapred.Task$Counter", "REDUCE_OUTPUT_RECORDS").getValue();
        WikipediaDocnoMapping.writeDocnoMappingData(FileSystem.get(getConf()), tmpPath + "/part-r-00000",
                (int) cnt, outputFile);
        FileSystem.get(getConf()).delete(new Path(tmpPath), true);
        return 0;

    } else {
        return -1;
    }
}

From source file:edu.umd.gorden2.BuildInvertedIndexCompressed.java

/**
 * Runs this tool./*from   ww  w  . ja  va  2  s  .  co m*/
 */
@SuppressWarnings({ "static-access" })
public int run(String[] args) throws Exception {
    Options options = new Options();

    options.addOption(OptionBuilder.withArgName("path").hasArg().withDescription("input path").create(INPUT));
    options.addOption(OptionBuilder.withArgName("path").hasArg().withDescription("output path").create(OUTPUT));
    options.addOption(OptionBuilder.withArgName("num").hasArg().withDescription("number of reducers")
            .create(NUM_REDUCERS));

    CommandLine cmdline;
    CommandLineParser parser = new GnuParser();

    try {
        cmdline = parser.parse(options, args);
    } catch (ParseException exp) {
        System.err.println("Error parsing command line: " + exp.getMessage());
        return -1;
    }

    if (!cmdline.hasOption(INPUT) || !cmdline.hasOption(OUTPUT)) {
        System.out.println("args: " + Arrays.toString(args));
        HelpFormatter formatter = new HelpFormatter();
        formatter.setWidth(120);
        formatter.printHelp(this.getClass().getName(), options);
        ToolRunner.printGenericCommandUsage(System.out);
        return -1;
    }

    String inputPath = cmdline.getOptionValue(INPUT);
    String outputPath = cmdline.getOptionValue(OUTPUT);
    int reduceTasks = cmdline.hasOption(NUM_REDUCERS) ? Integer.parseInt(cmdline.getOptionValue(NUM_REDUCERS))
            : 1;

    LOG.info("Tool name: " + BuildInvertedIndexCompressed.class.getSimpleName());
    LOG.info(" - input path: " + inputPath);
    LOG.info(" - output path: " + outputPath);
    LOG.info(" - num reducers: " + reduceTasks);

    Job job = Job.getInstance(getConf());
    job.setJobName(BuildInvertedIndexCompressed.class.getSimpleName());
    job.setJarByClass(BuildInvertedIndexCompressed.class);

    job.setNumReduceTasks(reduceTasks);

    FileInputFormat.setInputPaths(job, new Path(inputPath));
    FileOutputFormat.setOutputPath(job, new Path(outputPath));

    job.setMapOutputKeyClass(PairOfStringInt.class);
    job.setMapOutputValueClass(IntWritable.class);
    job.setOutputKeyClass(Text.class);
    job.setOutputValueClass(ArrayListWritable.class);
    job.setOutputFormatClass(MapFileOutputFormat.class);

    job.setMapperClass(MyMapper.class);
    job.setReducerClass(MyReducer.class);
    job.setPartitionerClass(MyPartitioner.class);

    // Delete the output directory if it exists already.
    Path outputDir = new Path(outputPath);
    FileSystem.get(getConf()).delete(outputDir, true);

    long startTime = System.currentTimeMillis();
    job.waitForCompletion(true);
    System.out.println("Job Finished in " + (System.currentTimeMillis() - startTime) / 1000.0 + " seconds");

    return 0;
}

From source file:com.sdw.dream.spark.examples.ml.JavaOneVsRestExample.java

@SuppressWarnings("static")
private static Options generateCommandlineOptions() {
    Option input = OptionBuilder.withArgName("input").hasArg().isRequired()
            .withDescription("input path to labeled examples. This path must be specified").create("input");
    Option testInput = OptionBuilder.withArgName("testInput").hasArg()
            .withDescription("input path to test examples").create("testInput");
    Option fracTest = OptionBuilder.withArgName("testInput").hasArg()
            .withDescription("fraction of data to hold out for testing."
                    + " If given option testInput, this option is ignored. default: 0.2")
            .create("fracTest");
    Option maxIter = OptionBuilder.withArgName("maxIter").hasArg()
            .withDescription("maximum number of iterations for Logistic Regression. default:100")
            .create("maxIter");
    Option tol = OptionBuilder.withArgName("tol").hasArg()
            .withDescription(/*from  www  . j  a  v a 2s.c o  m*/
                    "the convergence tolerance of iterations " + "for Logistic Regression. default: 1E-6")
            .create("tol");
    Option fitIntercept = OptionBuilder.withArgName("fitIntercept").hasArg()
            .withDescription("fit intercept for logistic regression. default true").create("fitIntercept");
    Option regParam = OptionBuilder.withArgName("regParam").hasArg()
            .withDescription("the regularization parameter for Logistic Regression.").create("regParam");
    Option elasticNetParam = OptionBuilder.withArgName("elasticNetParam").hasArg()
            .withDescription("the ElasticNet mixing parameter for Logistic Regression.")
            .create("elasticNetParam");

    Options options = new Options().addOption(input).addOption(testInput).addOption(fracTest).addOption(maxIter)
            .addOption(tol).addOption(fitIntercept).addOption(regParam).addOption(elasticNetParam);

    return options;
}

From source file:edu.umd.cloud9.example.bigram.BigramRelativeFrequencyTuple.java

/**
 * Runs this tool.//from   w  ww  . j a v  a 2  s.co  m
 */
@SuppressWarnings({ "static-access" })
public int run(String[] args) throws Exception {
    Options options = new Options();

    options.addOption(OptionBuilder.withArgName("path").hasArg().withDescription("input path").create(INPUT));
    options.addOption(OptionBuilder.withArgName("path").hasArg().withDescription("output path").create(OUTPUT));
    options.addOption(OptionBuilder.withArgName("num").hasArg().withDescription("number of reducers")
            .create(NUM_REDUCERS));

    CommandLine cmdline;
    CommandLineParser parser = new GnuParser();

    try {
        cmdline = parser.parse(options, args);
    } catch (ParseException exp) {
        System.err.println("Error parsing command line: " + exp.getMessage());
        return -1;
    }

    if (!cmdline.hasOption(INPUT) || !cmdline.hasOption(OUTPUT)) {
        System.out.println("args: " + Arrays.toString(args));
        HelpFormatter formatter = new HelpFormatter();
        formatter.setWidth(120);
        formatter.printHelp(this.getClass().getName(), options);
        ToolRunner.printGenericCommandUsage(System.out);
        return -1;
    }

    String inputPath = cmdline.getOptionValue(INPUT);
    String outputPath = cmdline.getOptionValue(OUTPUT);
    int reduceTasks = cmdline.hasOption(NUM_REDUCERS) ? Integer.parseInt(cmdline.getOptionValue(NUM_REDUCERS))
            : 1;

    LOG.info("Tool name: " + BigramRelativeFrequencyTuple.class.getSimpleName());
    LOG.info(" - input path: " + inputPath);
    LOG.info(" - output path: " + outputPath);
    LOG.info(" - num reducers: " + reduceTasks);

    Job job = Job.getInstance(getConf());
    job.setJobName(BigramRelativeFrequencyTuple.class.getSimpleName());
    job.setJarByClass(BigramRelativeFrequencyTuple.class);

    job.setNumReduceTasks(reduceTasks);

    FileInputFormat.setInputPaths(job, new Path(inputPath));
    FileOutputFormat.setOutputPath(job, new Path(outputPath));

    job.setMapOutputKeyClass(BinSedesTuple.class);
    job.setMapOutputValueClass(FloatWritable.class);
    job.setOutputKeyClass(BinSedesTuple.class);
    job.setOutputValueClass(FloatWritable.class);
    job.setOutputFormatClass(SequenceFileOutputFormat.class);

    job.setMapperClass(MyMapper.class);
    job.setCombinerClass(MyCombiner.class);
    job.setReducerClass(MyReducer.class);
    job.setPartitionerClass(MyPartitioner.class);

    // Delete the output directory if it exists already.
    Path outputDir = new Path(outputPath);
    FileSystem.get(getConf()).delete(outputDir, true);

    long startTime = System.currentTimeMillis();
    job.waitForCompletion(true);
    System.out.println("Job Finished in " + (System.currentTimeMillis() - startTime) / 1000.0 + " seconds");

    return 0;
}

From source file:esg.node.security.shell.cmds.ESGFgroupadd.java

public void doInitOptions() {
    OptionGroup autoGroup = new OptionGroup();
    autoGroup.addOption(new Option("auto", "auto-approve", false, "Set auto approval for joining this group"));
    autoGroup.addOption(//from  w  w w  .j  a v a 2 s  . com
            new Option("no_auto", "no-auto-approve", false, "Set auto approval for joining this group"));
    getOptions().addOptionGroup(autoGroup);

    OptionGroup visGroup = new OptionGroup();
    visGroup.addOption(new Option("vis", "visible", false, "Sets whether this group is visible to registry"));
    visGroup.addOption(
            new Option("no_vis", "not-visible", false, "Sets whether this group is visible to registry"));
    getOptions().addOptionGroup(visGroup);

    Option description = OptionBuilder.withArgName("description").hasArg(true)
            .withDescription("Description of group").withLongOpt("description").create("d");
    getOptions().addOption(description);

    Option name = OptionBuilder.withArgName("name").hasArg(true).withDescription("Description of group")
            .withLongOpt("name").isRequired(true).create("n");
    getOptions().addOption(name);

}

From source file:esg.node.security.shell.cmds.ESGFgroupmod.java

public void doInitOptions() {
    OptionGroup autoGroup = new OptionGroup();
    autoGroup.addOption(new Option("auto", "auto-approve", false, "Set auto approval for joining this group"));
    autoGroup.addOption(/*  www.j a va  2  s.  com*/
            new Option("no_auto", "no-auto-approve", false, "Set auto approval for joining this group"));
    getOptions().addOptionGroup(autoGroup);

    OptionGroup visGroup = new OptionGroup();
    visGroup.addOption(new Option("vis", "visible", false, "Sets whether this group is visible to registry"));
    visGroup.addOption(
            new Option("no_vis", "not-visible", false, "Sets whether this group is visible to registry"));
    getOptions().addOptionGroup(visGroup);

    Option description = OptionBuilder.withArgName("description").hasArgs()
            .withDescription("Description of group").withLongOpt("description").create("d");
    getOptions().addOption(description);

    Option rename = OptionBuilder.withArgName("current-name new-name").hasArgs(2)
            .withDescription("rename current groupname to new name").withLongOpt("rename").create("mv");
    getOptions().addOption(rename);

}

From source file:com.zergiu.tvman.TVManOptions.java

@SuppressWarnings("static-access")
private static Options createOptions() {
    Options options = new Options();
    Option help = new Option("help", "print help information");
    Option help2 = new Option("?", "print help information");
    Option debug = new Option("debug", "print debugging information");
    Option quiet = new Option("quiet", "be quiet");
    Option dbLoc = OptionBuilder.withArgName("folder").hasArg()
            .withDescription("Where to store and look for the database").create("db");
    Option host = OptionBuilder.withArgName("host|ip").hasArg()
            .withDescription(// w  ww . j a v a2s. com
                    "Specifies the host to listen to (default localhost, use 0.0.0.0 for all interfaces)")
            .create("host");
    Option port = OptionBuilder.withArgName("port").hasArg()
            .withDescription("Specifies the port to listen on (default 8080)").create("port");
    Option maxThreads = OptionBuilder.withArgName("number").hasArg()
            .withDescription("The maximum number of threads to spawn at a time (default 20)")
            .create("maxThreads");
    Option maxIdleTime = OptionBuilder.withArgName("number").hasArg()
            .withDescription("Set the maximum Idle time for a connection in milliseconds (default 30000)")
            .create("maxIdleTime");
    Option useIO = new Option("useIO",
            "Tells the application to use blocking IO instead of Non-Blocking IO (the default)");
    Option ssl = new Option("ssl",
            "If true start an SSL connection. You may want to specify the port as well to something more appropriate (e.g. 8443) and use https:// when accessing the application.");
    Option keystorePath = OptionBuilder.withArgName("path").hasArg()
            .withDescription("Specifies the path to the keystore (default ./keystore)").create("keystorePath");
    Option keystorePassword = OptionBuilder.withArgName("password").hasArg().withDescription(
            "Specify the keystore password (default 'password'). You can use the jetty password obfuscation utility to obfuscate it http://wiki.eclipse.org/Jetty/Howto/Secure_Passwords")
            .create("keystorePassword");
    Option keystoreManagerPassword = OptionBuilder.withArgName("password").hasArg().withDescription(
            "Specify the keystore manager password (default 'password'). You can use the jetty password obfuscation utility to obfuscate it http://wiki.eclipse.org/Jetty/Howto/Secure_Passwords")
            .create("keystoreManagerPassword");
    Option trustStorePath = OptionBuilder.withArgName("path").hasArg()
            .withDescription("Specifies the path to the trust store (default <keystorePath>")
            .create("trustStorePath");
    Option trustStorePassword = OptionBuilder.withArgName("password").hasArg().withDescription(
            "Specify the trust store password (default 'password'). You can use the jetty password obfuscation utility to obfuscate it http://wiki.eclipse.org/Jetty/Howto/Secure_Passwords")
            .create("trustStorePassword");
    Option noSystemTray = new Option("noSystemTray", "Dont show system tray icon");

    options.addOption(help);
    options.addOption(help2);
    options.addOption(debug);
    options.addOption(quiet);
    options.addOption(dbLoc);
    options.addOption(host);
    options.addOption(port);
    options.addOption(maxThreads);
    options.addOption(maxIdleTime);
    options.addOption(useIO);
    options.addOption(ssl);
    options.addOption(keystorePath);
    options.addOption(keystorePassword);
    options.addOption(keystoreManagerPassword);
    options.addOption(trustStorePath);
    options.addOption(trustStorePassword);
    options.addOption(noSystemTray);
    return options;
}

From source file:ch.eiafr.cojac.Arg.java

@SuppressWarnings("static-access")
static Options createOptions() {
    Options options = new Options();

    options.addOption(Arg.HELP.shortOpt(), "help", false, "Print the help of the program and exit");
    options.addOption(Arg.VERBOSE.shortOpt(), "verbose", false, "Display some internal traces");
    options.addOption(Arg.PRINT.shortOpt(), "console", false,
            "Signal problems with console messages to stderr (default signaling policy)");
    options.addOption(Arg.EXCEPTION.shortOpt(), "exception", false,
            "Signal problems by throwing an ArithmeticException");
    options.addOption(OptionBuilder.withLongOpt("callback").withArgName("meth").hasArg()
            .withDescription("Signal problems by calling " + "a user-supplied method matching this signature:"
                    + "\n...public static void f(String msg) \n"
                    + "(Give a fully qualified identifier in the form: \n" + "pkgA/myPkg/myClass/myMethod)")
            .create(Arg.CALL_BACK.shortOpt()));
    options.addOption(OptionBuilder.withLongOpt("logfile").withArgName("path").hasOptionalArg()
            .withDescription("Signal problems by writing to a log file.\n" + "Default filename is: "
                    + Args.DEFAULT_LOG_FILE_NAME + '.')
            .create(Arg.LOG_FILE.shortOpt()));
    options.addOption(Arg.DETAILED_LOG.shortOpt(), "detailed", false,
            "Log the full stack trace (combined with -Cc or -Cl)");
    options.addOption(OptionBuilder.withLongOpt("bypass").withArgName("prefixes").hasOptionalArg()
            .withDescription("Bypass classes starting with one of these prefixes (semi-colon separated list). "
                    + "\nExample: -Xb foo;bar.util\n will skip classes with name foo* or bar.util*")
            .create(Arg.BYPASS.shortOpt()));
    options.addOption(Arg.FILTER.shortOpt(), "filter", false, "Report each problem only once per faulty line");
    options.addOption(Arg.RUNTIME_STATS.shortOpt(), "summary", false, "Print runtime statistics");
    options.addOption(Arg.INSTRUMENTATION_STATS.shortOpt(), "stats", false, "Print instrumentation statistics");

    options.addOption(Arg.JMX_ENABLE.shortOpt(), false, "Enable JMX feature");
    options.addOption(OptionBuilder.withArgName("host").hasArg()
            .withDescription("Set remote JMX connection host (default: localhost)")
            .create(JMX_HOST.shortOpt()));
    options.addOption(OptionBuilder.withArgName("port").hasArg()
            .withDescription("Set remote JMX connection port (default: 5017)").create(JMX_PORT.shortOpt()));
    options.addOption(OptionBuilder.withArgName("MBean-id").hasArg()
            .withDescription("Set remote MBean name (default: COJAC)").create(JMX_NAME.shortOpt()));

    //        options.addOption(Arg.REPLACE_FLOATS.shortOpt(),
    //            "replacefloats", false, "Replace floats by Cojac-wrapper objects ");

    options.addOption(OptionBuilder.withArgName("class").hasArg()
            .withDescription("Select the double container (don't use it!).\n"
                    + "Example: -Wd cojac.BigDecimalDouble will use ch.eiafr.cojac.models.wrappers.BigDecimalDouble")
            .create(DOUBLE_WRAPPER.shortOpt()));
    options.addOption(OptionBuilder.withArgName("class").hasArg()
            .withDescription("Select the float container. See -Wd.").create(FLOAT_WRAPPER.shortOpt()));
    options.addOption(OptionBuilder.withArgName("class").hasArg()
            .withDescription("Select the wrapper (don't use it!).\n"
                    + "Example: -W cojac.WrapperBasic will use ch.eiafr.cojac.models.wrappers.WrapperBasic")
            .create(NG_WRAPPER.shortOpt()));

    options.addOption(OptionBuilder.withLongOpt("bigdecimal").withArgName("digits").hasArg()
            .withDescription("Use BigDecimal wrapping with a certain precision (number of digits).\n"
                    + "Example: -Rb 100 will wrap with 100-significant-digit BigDecimals")
            .create(BIG_DECIMAL_PRECISION.shortOpt()));

    options.addOption(Arg.INTERVAL.shortOpt(), "interval", false, "Use interval computation wrapping");
    options.addOption(Arg.STOCHASTIC.shortOpt(), "stochastic", false,
            "Use discrete stochastic arithmetic wrapping");
    options.addOption(Arg.AUTOMATIC_DERIVATION.shortOpt(), "autodiff", false,
            "Use automatic differentiation wrapping");

    options.addOption(Arg.DISABLE_UNSTABLE_COMPARISONS_CHECK.shortOpt(), false,
            "Disable unstability checks in comparisons, for the Interval or Stochastic wrappers");
    options.addOption(OptionBuilder.withArgName("epsilon").hasArg().withDescription(
            "Relative precision considered unstable, for Interval/Stochastic wrappers (default 0.00001)")
            .create(STABILITY_THRESHOLD.shortOpt()));

    options.addOption(Arg.ALL.shortOpt(), "all", false, "Sniff everywhere (this is the default behavior)");
    options.addOption(Arg.NONE.shortOpt(), "none", false, "Don't sniff at all");
    options.addOption(Arg.OPCODES.shortOpt(), true,
            "Sniff in those (comma separated) opcodes; eg: " + allOpcodes);
    options.addOption(Arg.MATHS.shortOpt(), false, "Sniff in (Strict)Math.xyz() methods");
    options.addOption(Arg.INTS.shortOpt(), false, "Sniff in ints opcodes");
    options.addOption(Arg.LONGS.shortOpt(), false, "Sniff in longs opcodes");
    options.addOption(Arg.CASTS.shortOpt(), false, "Sniff in casts opcodes");
    options.addOption(Arg.DOUBLES.shortOpt(), false, "Sniff in doubles opcodes");
    options.addOption(Arg.FLOATS.shortOpt(), false, "Sniff in floats opcodes");

    return options;
}