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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to