commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject RE: [CLI] Feature requests and submissions
Date Thu, 01 Aug 2002 14:34:04 GMT
About setting up options...

I am not sure how to do this in CLI--I will be checking the docs,
but I want to point out the following capabilities that Avalon
CLI has, which might help you in Commons CLI.

Avalon's CLI Parser has some constants to allow us to specify
information about our options like the following:

CLOptionDescriptor.ARGUMENT_DISALLOWED
CLOptionDescriptor.ARGUMENT_OPTIONAL
CLOptionDescriptor.ARGUMENT_REQUIRED
CLOptionDescriptor.ARGUMENTS_REQUIRED_2

ARGUMENT_DISALLOWED -- The presence of an argument
                       following the option is an error
                       condition handled by the CLI parser

ARGUMENT_OPTIONAL -- The option may or may not have an argument
                     following.  If it is there, include it
                     with the option.  If not, there is no error
                     condition.

ARGUMENT_REQUIRED -- There is one and only one argument following
                     the option.  If it does not exist throw an
                     exception.  If there are more than one option
                     throw an exception.

ARGUMENT_REQUIRED_2 -- There are two arguments following the option.
                       If they do not exist throw an exception.  If
                       there are more than two arguments, throw an
                       exception.


They are used to enable the following types of CLI options:

ARGUMENT_DISALLOWED:

-h -v -V

(help, verbose, version)  Flag style options

ARGUMENT_OPTIONAL

-taint test -L INFO

(taint checks, Logging level)  Turn on ***, with the optional level

ARGUMENT_REQUIRED

-f filename

(file) Use ***

ARGUMENT_REQUIRED_2

-Dhoser=beer -define endline eh?

(define) Supply to arguments for each option--usually for definition
         style options.


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