commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Keyes <>
Subject Re: [CLI] Configurable Parsers
Date Sat, 15 Jun 2002 23:26:31 GMT
> If the char parameter is replaced with
> a String parameter then both types of Option can be
> created.  From a users perspective this would involve
> changing the creation of the Options instance e.g.
> Options = new Options().addOption( 'f', false, "filename" );
> would have to change to:
> Options = new Options().addOption( "f", false, "filename" );
I have just implemented this API change and modified the Unit
tests to use the new API.  All of the tests pass.  My new tests
for the GnuParser also work ;)

I can add deprecated 'char' methods, but as CLI has not had
a release yet this is probably an unnecessary step.

I sent a mail to ant-dev before about the style of command line
they use and I was told it is GNU style.  Having looked at the
GNU guidelines [1] I still couldn't see where it recommends the
long options prefixed with a single '-'.

This doc did state though that:
   "Note that the GNU version of getopt will normally permit
    options anywhere among the arguments unless the special
    argument `--' is used. This is not what POSIX specifies;
    it is a GNU extension."

So strictly speaking the style of processing the current 'burst'
method performs is not POSIX compliant.  This is the source of
confusion over my naming the current parser, PosixParser and the
new parser GnuParser.  Does anybody have any suggestions for names
for these parsers?

-John K

> What do people think of this idea?
> Cheers,
> -John K
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-
> For additional commands, e-mail: <mailto:commons-dev-

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

View raw message