commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Dixon-Peugh <dpe...@mindspring.com>
Subject [cli] Suggestions
Date Sun, 06 Jan 2002 01:05:40 GMT

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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message