Package net.sourceforge.argparse4j.helper

Examples of net.sourceforge.argparse4j.helper.PrefixPattern


        this.textWidthCounter_ = textWidthCounter;
        if (prefixChars == null || prefixChars.isEmpty()) {
            throw new IllegalArgumentException(
                    "prefixChars cannot be a null or empty");
        }
        this.prefixPattern_ = new PrefixPattern(prefixChars);
        if (fromFilePrefix != null) {
            this.fromFilePrefixPattern_ = new PrefixPattern(fromFilePrefix);
        }
        if (addHelp) {
            ResourceBundle bundle = ResourceBundle.getBundle(this.getClass().getName());
            String prefix = prefixChars.substring(0, 1);
            addArgument(prefix + "h", prefix + prefix + "help")
View Full Code Here


    private PrefixPattern prefix;

    @Before
    public void setup() {
        prefix = new PrefixPattern(ArgumentParsers.DEFAULT_PREFIX_CHARS);
    }
View Full Code Here

        }
    }

    @Test
    public void testArgumentWithPrefix() {
        PrefixPattern prefix = new PrefixPattern("-+");
        ArgumentImpl arg = new ArgumentImpl(prefix, "-f", "-+foo-bar", "++foo");
        assertNull(arg.getName());
        assertEquals("foo_bar", arg.getDest());
        assertEquals("FOO_BAR", arg.resolveMetavar()[0]);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.argparse4j.helper.PrefixPattern

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.