commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Räss <co...@gmx.ch>
Subject [CLI] Commands & arguments
Date Mon, 29 Mar 2004 06:39:03 GMT
hi

I was wondering why commands expect the argument before its children. 
For instance if I create the following command:

ArgumentBuilder abuilder;
CommandBuilder cbuilder;
GroupBuilder gbuilder;

Command cmd = cbuilder.withName("test")
    .withChildren(
        gbuilder.withName("children")
            .withOption(
                obuilder.withLongName("myoption")
                    .create()
            )
            .create()
    )
    .withArgument(
        abuilder.withName("file")
            .withMinimum(1)
            .create()
    )
    .create();

The usage says that the command line must look like:
test <file1> [<file2> ...] --myoption

However this is not the 'normal' order. CVS style commands have the 
options first, then the arguments.

I've checked the CvsTest sample but it does not create the full CVS 
command line options. The options of a command are command specific. The 
test does not show how to attach options to a command (I assume this is 
done by adding children, correct?).

Am I missing something? Any suggestions?

Simon


---------------------------------------------------------------------
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