Package org.apache.commons.cli

Examples of org.apache.commons.cli.OptionGroup


    private Options createAdminOptions() {
        Options adminOptions = new Options();
        Option url = new Option(URL_OPTION, true, "Falcon URL");
        adminOptions.addOption(url);

        OptionGroup group = new OptionGroup();
        Option status = new Option(STATUS_OPTION, false,
                "show the current system status");
        Option version = new Option(VERSION_OPTION, false,
                "show Falcon server build version");
        Option stack = new Option(STACK_OPTION, false,
                "show the thread stack dump");
        Option help = new Option("help", false, "show Falcon help");
        group.addOption(status);
        group.addOption(version);
        group.addOption(stack);
        group.addOption(help);

        adminOptions.addOptionGroup(group);
        return adminOptions;
    }
View Full Code Here


        Option dependency = new Option(DEPENDENCY_OPT, false,
                "Gets the dependencies of entity");
        Option list = new Option(LIST_OPT, false,
                "List entities registerd for a type");

        OptionGroup group = new OptionGroup();
        group.addOption(submit);
        group.addOption(update);
        group.addOption(schedule);
        group.addOption(suspend);
        group.addOption(resume);
        group.addOption(delete);
        group.addOption(submitAndSchedule);
        group.addOption(validate);
        group.addOption(status);
        group.addOption(definition);
        group.addOption(dependency);
        group.addOption(list);

        Option url = new Option(URL_OPTION, true, "Falcon URL");
        Option entityType = new Option(ENTITY_TYPE_OPT, true,
                "Entity type, can be cluster, feed or process xml");
        entityType.setRequired(true);
View Full Code Here

                LOG_OPT,
                false,
                "Logs print the logs for process instances for a given process in "
                        + "the range start time and optional end time");

        OptionGroup group = new OptionGroup();
        group.addOption(running);
        group.addOption(status);
        group.addOption(summary);
        group.addOption(kill);
        group.addOption(resume);
        group.addOption(suspend);
        group.addOption(resume);
        group.addOption(rerun);
        group.addOption(logs);
        group.addOption(continues);

        Option url = new Option(URL_OPTION, true, "Falcon URL");
        Option start = new Option(START_OPT, true,
                "Start time is required for commands, status, kill, suspend, resume and re-run");
        Option end = new Option(
View Full Code Here

        Option vertex = new Option(VERTEX_CMD, false, "show the vertices");
        Option vertices = new Option(VERTICES_CMD, false, "show the vertices");
        Option vertexEdges = new Option(VERTEX_EDGES_CMD, false, "show the edges for a given vertex");
        Option edges = new Option(EDGE_CMD, false, "show the edges");

        OptionGroup group = new OptionGroup();
        group.addOption(vertex);
        group.addOption(vertices);
        group.addOption(vertexEdges);
        group.addOption(edges);
        graphOptions.addOptionGroup(group);

        Option id = new Option(ID_OPT, true, "vertex or edge id");
        graphOptions.addOption(id);
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

        // input options
        Option sourceOption = OptionBuilder.withArgName("SOURCE FILE").hasArg().withDescription("source file")
                .create('s');

        OptionGroup inputOptionGroup = new OptionGroup();
        inputOptionGroup.addOption(helpOption);
        inputOptionGroup.addOption(sourceOption);
        inputOptionGroup.isRequired();

        Option targetOption = OptionBuilder.withArgName("TARGET FILE").hasArg().withDescription("target file")
                .create('t');

        // general options
        Option linesOption = OptionBuilder.withArgName("LINES").hasArg().withDescription("lines to use").create('l');

        Option regexOption = OptionBuilder.withArgName("TOKENIZER REGEX").hasArg().withDescription("regex for tokens")
                .withLongOpt("tok").create();
        Option regexFileOption = OptionBuilder.withArgName("TOKENIZER REGEX FILE").hasArg()
                .withDescription("regex file for tokens").withLongOpt("tokfile").create();

        Option stopOption = OptionBuilder.withArgName("STOPWORD FILE").hasArg().withDescription("stopword file")
                .withLongOpt("stop").create();

        Option srcStopOption = OptionBuilder.withArgName("SOURCE STOPWORD FILE").hasArg()
                .withDescription("source stopword file").withLongOpt("sstop").create();

        Option dstStopOption = OptionBuilder.withArgName("TARGET STOPWORD FILE").hasArg()
                .withDescription("target stopword file").withLongOpt("tstop").create();

        Option separatorOption = OptionBuilder.withArgName("SEPARATOR FILE").hasArg().withDescription("separator file")
                .withLongOpt("sep").create();

        Option srcSeparatorOption = OptionBuilder.withArgName("SOURCE SEPARATOR FILE").hasArg()
                .withDescription("source separator file").withLongOpt("ssep").create();

        Option dstSeparatorOption = OptionBuilder.withArgName("TARGET SEPARATOR FILE").hasArg()
                .withDescription("target separator file").withLongOpt("tsep").create();

        Option depthOption = OptionBuilder.withArgName("DEPTH").hasArg().withDescription("gappy phrase depth")
                .withLongOpt("depth").create("d");
        Option maxDepthOption = OptionBuilder.withArgName("MAX DEPTH").hasArg()
                .withDescription("max gappy phrase depth").withLongOpt("max-depth").create("m");

        Option srcDepthOption = OptionBuilder.withArgName("SOURCE DEPTH").hasArg()
                .withDescription("source gappy phrase depth").withLongOpt("src-depth").create("sd");
        Option srcMaxDepthOption = OptionBuilder.withArgName("SOURCE MAX DEPTH").hasArg()
                .withDescription("max source gappy phrase depth").withLongOpt("src-max-depth").create("sm");

        Option dstDepthOption = OptionBuilder.withArgName("TARGET DEPTH").hasArg()
                .withDescription("target gappy phrase depth").withLongOpt("trg-depth").create("td");
        Option dstMaxDepthOption = OptionBuilder.withArgName("TARGET MAX DEPTH").hasArg()
                .withDescription("max target gappy phrase depth").withLongOpt("trg-max-depth").create("tm");

        Option wsizeOption = OptionBuilder.withArgName("WINDOW SIZE").hasArg()
                .withDescription("window size of a gappy phrase").withLongOpt("wsize").create("w");

        Option cratioOption = OptionBuilder.withArgName("MIN CONTEXT RATIO").hasArg()
                .withDescription("minimal left/right ratio").withLongOpt("cratio").create();

        Option nfillOption = OptionBuilder.withArgName("MIN NON-EMPTY FILLERS").hasArg()
                .withDescription("minimal non-empty fillers count").withLongOpt("nfill").create();

        Option delOption = OptionBuilder.withArgName("DELIMITER").hasArg().withDescription("delimiter for printing")
                .withLongOpt("del").create();

        // alignment related options
        Option simOption = OptionBuilder.withArgName("MIN SIMILARITY").hasArg().withDescription("minimal similarity")
                .withLongOpt("sim").create();

        Option numOption = OptionBuilder.withArgName("ALIGNMENTS").hasArg().withDescription("number of top alignments")
                .create('n');

        Option vsizeOption = OptionBuilder.withArgName("VECTOR SIZE").hasArg().withDescription("minimal vector size")
                .withLongOpt("vsize").create();

        Option maxOption = OptionBuilder.withDescription("output only maximal repeats").withLongOpt("max").create();
        Option smaxOption = OptionBuilder.withDescription("output only supermaximal repeats").withLongOpt("smax")
                .create();

        Option verboseOption = OptionBuilder.withDescription("verbose").create('v');

        Option laTeXOption = OptionBuilder.withDescription("output LaTeX when possible").create('x');

        // actions
        OptionGroup actionOptionGroup = new OptionGroup();
        actionOptionGroup.addOption(OptionBuilder.withDescription("print allignments").create('a'));
        actionOptionGroup.addOption(OptionBuilder.withDescription("print corpus info").create('i'));
        actionOptionGroup.addOption(OptionBuilder.withDescription("print tokens").create('z'));
        actionOptionGroup.addOption(OptionBuilder.withDescription("print repeats").create('r'));
        actionOptionGroup.isRequired();

        options.addOptionGroup(inputOptionGroup);
        options.addOptionGroup(actionOptionGroup);
        options.addOption(targetOption);
        options.addOption(linesOption);
View Full Code Here

    // create the Options
    Options options = new Options();

    // create Options group
    OptionGroup optionGroup = new OptionGroup();
    optionGroup.addOption(serverOption);
    optionGroup.addOption(clientOption);
    optionGroup.addOption(helpOption);
    options.addOptionGroup(optionGroup);
    options.addOption(portOption);
    options.addOption(addrOption);

    try {
View Full Code Here

            options.addOption(OptionBuilder.withLongOpt(longOption)
                    .isRequired(false).hasArg(true).withType(String.class)
                    // .withDescription(desc.getString(opt) + " " + ISO_DATE)
                    .create(longOption.charAt(0)));

            OptionGroup calib = new OptionGroup();
            calib.addOption(makeOption(OPT_CALIBRATE, Date.class, 1,
                    "dateTimeList"));
            calib.addOption(makeOption(OPT_CALIBRATE_EXIF, Date.class, 1,
                    "jpegDateTimeList"));
            calib.addOption(makeOption(OPT_UTC_OFFSET, Double.class, 1, "secs"));
            options.addOptionGroup(calib);

            OptionGroup ogExif = new OptionGroup();
            ogExif.addOption(OptionBuilder.withLongOpt(OPT_EXIV2)
                    .isRequired(false).hasOptionalArg().withType(String.class)
                    // .withDescription(desc.getString(opt) + " " + ISO_DATE)
                    .create(OPT_EXIV2.charAt(0)));
            // addOption(makeOption(OPT_EXIV2, String.class, 1, "file"));
            ogExif.addOption(makeOption(OPT_EXIF, Boolean.class, 0, null));
            ogExif.addOption(makeOption(OPT_XMP, Boolean.class, 0, null));
            options.addOptionGroup(ogExif);

            options.addOption(makeOption(OPT_READ_XMP, Boolean.class, 0, null));
            options.addOption(makeOption(OPT_TEXT, File.class, 1, "file"));
            options.addOption(makeOption(OPT_XML, File.class, 1, "file"));
View Full Code Here

        }

        @Override
        protected Options createOptions() {
            Options options = super.createOptions();
            OptionGroup mode = new OptionGroup();
            mode.addOption(makeOption(OPT_GPX2OVL, Boolean.class, 0, null));
            mode.addOption(makeOption(OPT_OVL2GPX, Boolean.class, 0, null));
            options.addOptionGroup(mode);
            options.addOption(makeOption(OPT_TO_DIR, File.class, 1, "directory"));
            return options;
        }
View Full Code Here

  }
 
  @Override
  public Options getOptions() {
    final Options o = new Options();
    final OptionGroup setOrClear = new OptionGroup();
    scanOptAuths = new Option("s", "scan-authorizations", true, "scan authorizations to set");
    scanOptAuths.setArgName("comma-separated-authorizations");
    setOrClear.addOption(scanOptAuths);
    setOrClear.setRequired(true);
    o.addOptionGroup(setOrClear);
    userOpt = new Option(Shell.userOption, "user", true, "user to operate on");
    userOpt.setArgName("user");
    o.addOption(userOpt);
    return o;
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.