Package org.jnode.shell.syntax

Examples of org.jnode.shell.syntax.OptionSyntax


    @org.junit.Test
    public void testTwo() throws Exception {
        TestShell shell = new TestShell();
        shell.addAlias("cmd", "org.jnode.test.shell.syntax.OptionSyntaxTest$Test");
        shell.addSyntax("cmd", new RepeatSyntax(new OptionSyntax("fileArg", "file", 'f')));

        CommandLine cl;
        CommandInfo cmdInfo;
        Command cmd;
View Full Code Here


            sm.add(new SyntaxBundle("cpuid", new SequenceSyntax()));
            sm.add(new SyntaxBundle("alias",
                new EmptySyntax(null, "Print all available aliases and corresponding classnames"),
                new SequenceSyntax(null, "Set an aliases for given classnames",
                    new ArgumentSyntax("alias"), new ArgumentSyntax("classname")),
                new OptionSyntax("remove", 'r', null, "Remove an alias")));
        }
View Full Code Here

        }
    }

    @org.junit.Test
    public void testConstructor() {
        new PowersetSyntax(new OptionSyntax("intArg", 'i'), new OptionSyntax("fileArg", 'f'));
    }
View Full Code Here

    @org.junit.Test
    public void testFormat() {
        ArgumentBundle bundle = new Test().getArgumentBundle();
        Syntax syntax1 =
                new PowersetSyntax(new OptionSyntax("intArg", 'i'),
                        new OptionSyntax("fileArg", 'f'));
        Assert.assertEquals("[ ( -i <intArg> ) | ( -f <fileArg> ) ] ...", syntax1.format(bundle));
    }
View Full Code Here

    @org.junit.Test
    public void testOne() throws Exception {
        TestShell shell = new TestShell();
        shell.addAlias("cmd", "org.jnode.test.shell.syntax.PowersetSyntaxTest$Test");
        shell.addSyntax("cmd", new PowersetSyntax(new OptionSyntax("intArg", 'i'),
                new OptionSyntax("fileArg", 'f')));

        CommandLine cl;
        CommandInfo cmdInfo;
        Command cmd;
View Full Code Here

    @org.junit.Test
    public void testLazy() throws Exception {
        TestShell shell = new TestShell();
        shell.addAlias("cmd", "org.jnode.test.shell.syntax.PowersetSyntaxTest$Test");
        shell.addSyntax("cmd", new SequenceSyntax(new PowersetSyntax(
                new OptionSyntax("intArg", 'i'), new OptionSyntax("fileArg", 'f')),
                new RepeatSyntax(new OptionSyntax("otherArg", 'i'))));

        CommandLine cl;
        CommandInfo cmdInfo;
        Command cmd;
View Full Code Here

    @org.junit.Test
    public void testEager() throws Exception {
        TestShell shell = new TestShell();
        shell.addAlias("cmd", "org.jnode.test.shell.syntax.PowersetSyntaxTest$Test");
        shell.addSyntax("cmd", new SequenceSyntax(new PowersetSyntax(null, true, null,
                new OptionSyntax("intArg", 'i'), new OptionSyntax("fileArg", 'f')),
                new RepeatSyntax(new OptionSyntax("otherArg", 'i'))));

        CommandLine cl;
        CommandInfo cmdInfo;
        Command cmd;
View Full Code Here

TOP

Related Classes of org.jnode.shell.syntax.OptionSyntax

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.