axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Rineholt" <>
Subject Re: proposed: CLI Args improvement
Date Mon, 10 Sep 2001 16:49:00 GMT
Regarding -- or just - I would suggest investigating other Apache offerings
add see if there is any precedents set  and follow those.

Rick Rineholt
"The truth is out there...  All you need is a better search engine!"

Berin Loritsch <> on 09/10/2001 12:06:37 PM

Please respond to

To:   "" <>, Axis
      Development <>
Subject:  proposed: CLI Args improvement

Would it be possible to extend the CLI package in excalibur to
have a CLI Strategy?  Basically, there are two common strategies
in CLI parsing:

GNU style (which we support)
Java/CVS style (as-much-as-needed-to-be-unique).

Basically the approach would go like this:

CLOptionDescriptor optionDescriptors = new CLOptionDescriptor[] {
    new CLOptionDescriptor("version", 'v', VERSION, "Get the Version and
    new CLOptionDescriptor("valid", 'V', VALID, "Tests to see if the
configuration is Valid and quit")
parser = new CLArgsParser( args, optionDescriptors, control,
         // note: for backwards compatibility, the default would be

This would allow us to parse args in the following manner:

$myapp -ve[rsion]

MyApp Version 1.0


$myapp -va[lid]

MyApp Version 1.0
Error in configuration: line 20

By simply switching the strategy to AVALON_STRATEGY (above), we can perform
following calls:

$myapp (-v | --version)

MyApp Version 1.0


$myapp (-V | --valid)

MyApp Version 1.0
Error in configuration: line 20

That way, everyone can be made happy--AND as new strategies for CLI parsing
uncovered, we can support them easily.  This also allows for backwards

>From Tom Jordahl in XML-Axis dev:
I looked at this code (because I was writing the command line stuff in
wsdl2java) and it is very GNU-like in its option syntax:
instead of what we currently have:

I am not really in favor of this "two-dash" approach to options, I prefer
(obviously) an "as-much-as needed-to-be-unique" style.  If there is strong
sentiment from the group that we want "two-dash" style options, I would be
-1 on it but would still do the work. :-)

I am adding a -package switch today, which is an option that takes an
argument so I maybe I will convince myself I want to switch to Avalon. :-)

Tom Jordahl

View raw message