commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bob mcwhirter <>
Subject RE: [CLI] Making Option Extensible
Date Wed, 24 Jul 2002 17:24:52 GMT
> 1) Creating A Parser
> Instead, Commons CLI should provide an interface like the JSSE
> and JCE APIs.  Creating an instance of the CommandLineParser would
> be best if we have an optional argument:
> CommandLineParser parser = CommandLineParserFactory.newParser("GNU");
> Something along those lines would be best.

Makes sense to me.

> 2) Processing the Options
> Sometimes there are a lot of potential options that need to be parsed.
> The current Commons API requires you to provide a long if/then/else
> to process the options.  This is time consuming, and a lot more verbose
> than the way Avalon CLI does it.  Contrast it with the following
> approach:

That should be do-able, while still retaining the current hasOption()
pull type of processing instead of the push-type described below.
Best of both, I think.

> 3) Printing the usage/options

Yah, CLI does this.

> 4) Describing Options
> I think the Commons CLI is prettier, but this is what it looks like in
> Avalon:

See our recent discussion regarding the Builder pattern.  Should make it
prettier.    As far as static go, I don't know really what's wrong with
a static block to do some configuration.  Take a look, if you want,
at how I typically do CLI stuff in the Maven repository.

> Let's see if we can merge them together and make a better whole.



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message