You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by David Dixon-Peugh <dp...@mindspring.com> on 2002/01/06 02:05:40 UTC

[cli] Suggestions

I've been fooling with the CLI package in the
Sandbox, and I've got a few suggestions on how
it might be improved.

#1 - Usage Statement

Since we are setting up the Options class with
all the option possibilites and their descriptions,
it seems a logical place to generate a Usage
statement.

#2 - Default Values on Options

It seems that the default values are known when
the options are created.  It makes sense to set
the defaults when the Options object is created.

#3 - Integrate with Properties Object

It would be nice, if I could write something like
this:

public static void main(String args[]) {
    Options opt = new QuiltOptions("quilt.properties");

    try {
      Properties prop = opt.parse( args );
    } catch (MissingArgumentException e) {
      System.err.println( opt.getUsageStatement() );
      System.exit( -1 );
    }
}

What do you think?  I think it makes the code look
an awful lot cleaner than the way it works now.

Thanks,

DDP





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>