commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Co <...@exist.com>
Subject [CLI] Unexpected token while processing command
Date Wed, 06 Dec 2006 01:52:03 GMT
Hi,

I have this simple app:

public class Test {
    public static void main(String[] args) {
        args = new String[] {
                "start",
                "xbean:broker.xml"
        };

        ArgumentBuilder ab = new ArgumentBuilder();
        CommandBuilder cb = new CommandBuilder();
        GroupBuilder gb = new GroupBuilder();

        Group main = gb
                .withOption(cb
                        .withName("start")
                        .withArgument(ab
                                .withDefault("xbean:activemq.xml")
                                .withName("brokerUri")
                                .withMinimum(1)
                                .withMaximum(1)
                                .create()
                        )
                        .create()
                )
                .create();

        Parser p = new Parser();
        p.setGroup(main);
        p.parseAndHelp(args);
    }
}

and it returns

Unexpected xbean:broker.xml while processing 
start                             
Usage:                                                                          

 [start 
<brokerUri>]                                                           
start                                                                           

  start brokerUri

If I remove the withDefault() or if I set the maximum to 2, it processes 
successfully. Is this a bug or am I missing something here?

Regards,
Adrian Co

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message