Package org.apache.commons.cli

Examples of org.apache.commons.cli.OptionGroup


    Option dirOption = new Option("d", "dataDir", true, "Sesame data dir to 'connect' to");

    options.addOption(helpOption);
    options.addOption(versionOption);

    OptionGroup connectGroup = new OptionGroup();
    connectGroup.addOption(serverURLOption);
    connectGroup.addOption(dirOption);
    options.addOptionGroup(connectGroup);

    CommandLineParser argsParser = new PosixParser();

    try {
View Full Code Here


        OptionBuilder.withLongOpt(getConfig).withDescription("Get a config").create();
    getConfOption.setArgs(2);
    getConfOption.setRequired(false);
    getConfOption.setArgName("ConfigScope(e.g. CLUSTER=cluster,RESOURCE=rc,...) KeySet(e.g. k1,k2,...)");

    OptionGroup group = new OptionGroup();
    group.setRequired(true);
    group.addOption(rebalanceOption);
    group.addOption(addResourceOption);
    group.addOption(resourceModeOption);
    group.addOption(resourceBucketSizeOption);
    group.addOption(expandResourceOption);
    group.addOption(expandClusterOption);
    group.addOption(resourceKeyOption);
    group.addOption(addClusterOption);
    group.addOption(activateClusterOption);
    group.addOption(deleteClusterOption);
    group.addOption(addInstanceOption);
    group.addOption(listInstancesOption);
    group.addOption(listResourceOption);
    group.addOption(listClustersOption);
    group.addOption(addIdealStateOption);
    group.addOption(rebalanceOption);
    group.addOption(dropInstanceOption);
    group.addOption(swapInstanceOption);
    group.addOption(dropResourceOption);
    group.addOption(instanceInfoOption);
    group.addOption(clusterInfoOption);
    group.addOption(resourceInfoOption);
    group.addOption(partitionInfoOption);
    group.addOption(enableInstanceOption);
    group.addOption(enablePartitionOption);
    group.addOption(enableClusterOption);
    group.addOption(resetPartitionOption);
    group.addOption(resetInstanceOption);
    group.addOption(resetResourceOption);
    group.addOption(addStateModelDefOption);
    group.addOption(listStateModelsOption);
    group.addOption(listStateModelOption);
    group.addOption(addStatOption);
    group.addOption(addAlertOption);
    group.addOption(dropStatOption);
    group.addOption(dropAlertOption);
    group.addOption(setConfOption);
    group.addOption(getConfOption);
    group.addOption(addResourcePropertyOption);
    group.addOption(removeResourcePropertyOption);

    Options options = new Options();
    options.addOption(helpOption);
    options.addOption(zkServerOption);
    options.addOptionGroup(group);
View Full Code Here

    options.addOption("f", "framed", false, "Use framed transport");
    options.addOption("c", "compact", false, "Use the compact protocol");
    options.addOption("h", "help", false, "Print help information");
    options.addOption(null, "infoport", true, "Port for web UI");

    OptionGroup servers = new OptionGroup();
    servers.addOption(
        new Option("nonblocking", false, "Use the TNonblockingServer. This implies the framed transport."));
    servers.addOption(new Option("hsha", false, "Use the THsHaServer. This implies the framed transport."));
    servers.addOption(new Option("threadpool", false, "Use the TThreadPoolServer. This is the default."));
    options.addOptionGroup(servers);
    return options;
  }
View Full Code Here

        .withDescription("Provide state trans delay").create();
    transDelayOption.setArgs(1);
    transDelayOption.setRequired(false);
    transDelayOption.setArgName("Delay time in state transition, in MS");

    OptionGroup optionGroup = new OptionGroup();
    optionGroup.addOption(zkServerOption);
    optionGroup.addOption(fileOption);

    Options options = new Options();
    options.addOption(helpOption);
    // options.addOption(zkServerOption);
    options.addOption(clusterOption);
View Full Code Here

        .withDescription("Provide state trans delay").create();
    transDelayOption.setArgs(1);
    transDelayOption.setRequired(false);
    transDelayOption.setArgName("Delay time in state transition, in MS");

    OptionGroup optionGroup = new OptionGroup();
    optionGroup.addOption(zkServerOption);
    optionGroup.addOption(fileOption);

    Options options = new Options();
    options.addOption(helpOption);
    // options.addOption(zkServerOption);
    options.addOption(clusterOption);
View Full Code Here

        .withDescription("Provide state trans delay").create();
    transDelayOption.setArgs(1);
    transDelayOption.setRequired(false);
    transDelayOption.setArgName("Delay time in state transition, in MS");

    OptionGroup optionGroup = new OptionGroup();
    optionGroup.addOption(zkServerOption);

    Options options = new Options();
    options.addOption(helpOption);
    options.addOption(clusterOption);
    options.addOption(hostOption);
View Full Code Here

        Option option = optionBuilder.create(ARGUMENT_MODULE_OVERRIDE_SHORTFORM);
        options.addOption(option);
    }

    protected void addProgressOptions() {
        OptionGroup optionGroup = new OptionGroup();

        Option option = new Option(ARGUMENT_NO_PROGRESS_SHORTFORM,
                ARGUMENT_NO_PROGRESS,
                false,
                "Suppress the normal startup progress bar. This is typically "
                        + "used when redirecting console output to a file, or starting "
                        + "the server from an IDE or other tool.");
        optionGroup.addOption(option);

        option = new Option(ARGUMENT_LONG_PROGRESS_SHORTFORM,
                ARGUMENT_LONG_PROGRESS,
                false,
                "Write startup progress to the console in a format that is "
                        + "suitable for redirecting console output to a file, or starting "
                        + "the server from an IDE or other tool (doesn't use linefeeds to "
                        + "update the progress information that is used by default if you " + "don't specify "
                        + ARGUMENT_NO_PROGRESS + " or " + ARGUMENT_LONG_PROGRESS + ").");
        optionGroup.addOption(option);

        options.addOptionGroup(optionGroup);
    }
View Full Code Here

        for (Iterator i = options.getOptions().iterator(); i.hasNext();) {
            // get the next Option
            option = (Option) i.next();

            // check if the option is part of an OptionGroup
            OptionGroup group = options.getOptionGroup(option);

            // if the option is part of a group and the group has not already
            // been processed
            if (group != null && !list.contains(group)) {

                // add the group to the processed list
                list.add(group);

                // get the names of the options from the OptionGroup
                Collection names = group.getNames();

                optionsBuff.append("[");

                // for each option in the OptionGroup
                for (Iterator iter = names.iterator(); iter.hasNext();) {
View Full Code Here

        Option help = new Option("h", "help", false,
        "Print help for the Rat command line interface and exit");
        opts.addOption(help);

        OptionGroup addLicenceGroup = new OptionGroup();
        String addLicenceDesc = "Add the default licence header to any file with an unknown licence that is not in the exclusion list. By default new files will be created with the licence header, to force the modification of existing files use the --force option.";

        Option addLicence = new Option(
                "a",
                "addLicence",
                false,
                addLicenceDesc);
        addLicenceGroup.addOption(addLicence);
        Option addLicense = new Option(
                "A",
                "addLicense",
                false,
                addLicenceDesc);
        addLicenceGroup.addOption(addLicense);
        opts.addOptionGroup(addLicenceGroup);

        Option write = new Option(
                "f",
                "force",
                false,
        "Forces any changes in files to be written directly to the source files (i.e. new files are not created)");
        opts.addOption(write);

        Option copyright = new Option(
                "c",
                "copyright",
                true,
        "The copyright message to use in the licence headers, usually in the form of \"Copyright 2008 Foo\"");
        opts.addOption(copyright);

        final Option exclude = OptionBuilder
                            .withArgName("expression")
                            .withLongOpt("exclude")
                            .hasArgs()
                            .withDescription("Excludes files matching wildcard <expression>. " +
                                    "Note that --dir is required when using this parameter. " +
                                    "Allows multiple arguments.")
                            .create(EXCLUDE_CLI);
        opts.addOption(exclude);

        final Option excludeFile = OptionBuilder
                            .withArgName("fileName")
                            .withLongOpt("exclude-file")
                            .hasArgs()
                            .withDescription("Excludes files matching regular expression in <file> " +
                                    "Note that --dir is required when using this parameter. " )
                            .create(EXCLUDE_FILE_CLI);
        opts.addOption(excludeFile);

        Option dir = new Option(
                "d",
                "dir",
                false,
        "Used to indicate source when using --exclude");
        opts.addOption(dir);

        OptionGroup outputType = new OptionGroup();

        Option xml = new Option(
                "x",
                "xml",
                false,
                "Output the report in raw XML format.  Not compatible with -s");
        outputType.addOption(xml);

        Option xslt = new Option(String.valueOf(STYLESHEET_CLI),
                                 "stylesheet",
                                 true,
                                 "XSLT stylesheet to use when creating the"
                                 + " report.  Not compatible with -x");
        outputType.addOption(xslt);
        opts.addOptionGroup(outputType);

        return opts;
    }
View Full Code Here

    options.addOption("i",true, "input file or directory");
    options.addOption("r",false,"process directories recursively when -i is a directory ");
    options.addOption("o",true, "output file");
    options.addOption("h",false,"print this message");
    options.addOption("v",false,"print version information");
    OptionGroup outputOptions = new OptionGroup();
    Option stdxml = new Option("x",false,"convert FITS output to a standard metadata schema");
    Option combinedStd = new Option("xc",false,"output using a standard metadata schema and include FITS xml");
    outputOptions.addOption(stdxml);
    outputOptions.addOption(combinedStd);
    options.addOptionGroup(outputOptions);

    CommandLineParser parser = new GnuParser();
    CommandLine cmd = parser.parse(options, args);
   
View Full Code Here

TOP

Related Classes of org.apache.commons.cli.OptionGroup

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.