Package net.sourceforge.argparse4j.inf

Examples of net.sourceforge.argparse4j.inf.ArgumentGroup.addArgument()


    public void testFormatHelpWithArgumentGroup()
            throws ArgumentParserException {
        ap.description("This is argparser4j.").epilog("This is epilog.");
        ArgumentGroup group = ap.addArgumentGroup("group1")
                .description("group1 description");
        group.addArgument("--foo");
        assertEquals(String.format(
                  TextHelper.LOCALE_ROOT,
                  "usage: argparse4j [-h] [--foo FOO]%n"
                + "%n"
                + "This is argparser4j.%n"
View Full Code Here


    @Test
    public void testFormatHelpWithArgumentGroupWithoutTitleAndDescription()
            throws ArgumentParserException {
        ap.description("This is argparser4j.").epilog("This is epilog.");
        ArgumentGroup group = ap.addArgumentGroup("");
        group.addArgument("--foo");
        assertEquals(String.format(
                  TextHelper.LOCALE_ROOT,
                  "usage: argparse4j [-h] [--foo FOO]%n"
                + "%n"
                + "This is argparser4j.%n"
View Full Code Here

    @Test
    public void testFormatHelpWithArgumentGroupWithoutHelp() throws ArgumentParserException {
        ArgumentParserImpl ap = new ArgumentParserImpl("argparse4j", false);
        ArgumentGroup group1 = ap.addArgumentGroup("group1").description(
                "group1 description");
        group1.addArgument("foo").help("foo help");
        ArgumentGroup group2 = ap.addArgumentGroup("group2").description(
                "group2 description");
        group2.addArgument("--bar").help("bar help");
        assertEquals(String.format(
                  TextHelper.LOCALE_ROOT,
View Full Code Here

        ArgumentGroup group1 = ap.addArgumentGroup("group1").description(
                "group1 description");
        group1.addArgument("foo").help("foo help");
        ArgumentGroup group2 = ap.addArgumentGroup("group2").description(
                "group2 description");
        group2.addArgument("--bar").help("bar help");
        assertEquals(String.format(
                  TextHelper.LOCALE_ROOT,
                  "usage: argparse4j [--bar BAR] foo%n"
                + "%n"
                + "group1:%n"
View Full Code Here

    @Test
    public void testFormatHelpWithSuppress()
            throws ArgumentParserException {
        ArgumentGroup group = ap.addArgumentGroup("group");
        group.addArgument("--foo");
        group.addArgument("--bar").help(Arguments.SUPPRESS);
        ap.addArgument("-a").help(Arguments.SUPPRESS).required(true);
        ap.addArgument("-b");
        MutuallyExclusiveGroup mutex1 = ap.addMutuallyExclusiveGroup("mutex1");
        mutex1.addArgument("-c").help(Arguments.SUPPRESS);
View Full Code Here

    @Test
    public void testFormatHelpWithSuppress()
            throws ArgumentParserException {
        ArgumentGroup group = ap.addArgumentGroup("group");
        group.addArgument("--foo");
        group.addArgument("--bar").help(Arguments.SUPPRESS);
        ap.addArgument("-a").help(Arguments.SUPPRESS).required(true);
        ap.addArgument("-b");
        MutuallyExclusiveGroup mutex1 = ap.addMutuallyExclusiveGroup("mutex1");
        mutex1.addArgument("-c").help(Arguments.SUPPRESS);
        mutex1.addArgument("-d");
View Full Code Here

                        }
                    });

            ArgumentGroup requiredGroup = parser.addArgumentGroup("Required arguments");

            Argument outputDirArg = requiredGroup.addArgument("--output-dir")
                    .metavar("HDFS_URI")
                    .type(new PathArgumentType(conf) {
                        @Override
                        public Path convert(ArgumentParser parser, Argument arg, String value) throws ArgumentParserException {
                            Path path = super.convert(parser, arg, value);
View Full Code Here

                    .type(Path.class)
                    .help("Local URI or HDFS URI of a UTF-8 encoded file containing a list of HDFS URIs to index, " +
                            "one URI per line in the file. If '-' is specified, URIs are read from the standard input. " +
                            "Multiple --input-list arguments can be specified.");

            Argument morphlineFileArg = requiredGroup.addArgument("--morphline-file")
                    .metavar("FILE")
                    .type(new FileArgumentType().verifyExists().verifyIsFile().verifyCanRead())
                    .required(true)
                    .help("Relative or absolute path to a local config file that contains one or more morphlines. " +
                            "The file must be UTF-8 encoded. Example: /path/to/morphline.conf");
View Full Code Here

                                    +
                                    " a replicated cluster with --shard-url, pass replica urls consecutively and also pass --shards. "
                                    + "If you are building shards for a SolrCloud cluster, pass the --zk-host argument. "
                                    + "Using --go-live requires either --shard-url or --zk-host.");

            Argument shardUrlsArg = clusterInfoGroup.addArgument("--shard-url")
                    .metavar("URL")
                    .type(String.class)
                    .action(Arguments.append())
                    .help("Solr URL to merge resulting shard into if using --go-live. " +
                            "Example: http://solr001.mycompany.com:8983/solr/collection1. " +
View Full Code Here

                    .help("Solr URL to merge resulting shard into if using --go-live. " +
                            "Example: http://solr001.mycompany.com:8983/solr/collection1. " +
                            "Multiple --shard-url arguments can be specified, one for each desired shard. " +
                            "If you are merging shards into a SolrCloud cluster, use --zk-host instead.");

            Argument zkHostArg = clusterInfoGroup.addArgument("--zk-host")
                    .metavar("STRING")
                    .type(String.class)
                    .help("The address of a ZooKeeper ensemble being used by a SolrCloud cluster. "
                            + "This ZooKeeper ensemble will be examined to determine the number of output "
                            +
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.