jopt-simple & sendopts was: hg: jigsaw/jake/jdk: jdk.joptsimple

Jaroslav Tulach jaroslav.tulach at oracle.com
Fri Aug 30 00:16:40 PDT 2013


Dne Čt 29. srpna 2013 07:35:58, mark.reinhold at oracle.com napsal(a):
> 2013/8/28 11:59 -0700, jaroslav.tulach at oracle.com:
> > Seems the kind of utility everyone has to write once from scratch, right?
> > I
> > did it as well as it seemed no existing parser matches our needs.
> 
> Yes.  We didn't write joptsimple; it was written by Paul Holser [1].
> It's not perfect, but it's better than all the others I surveyed a
> couple of years ago.

I see. I got confused by a source being commited into the Hg and considered 
that an attempt to write CLI parser from scratch.

> > NetBeans offers standalone, modular, ServiceLoader based, declarative,
> > POSIX complient approach for parsing command line arguments in a single
> > JAR API:  ...
> I didn't know this -- thanks for pointing it out.  I'll take a look.

SendOpts API[2] benefit could be its modularity support - e.g. various modules 
contribute its options and the system then verifies overall consistency of a 
command line and distributes the CLI arguments to appropriate modules. If such 
composition and decomposition is not needed then [1] looks OK and in certain 
areas (number format of an argument, for example) more powerful.
-jt

> [1] http://pholser.github.io/jopt-simple/
[2] http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-sendopts/


More information about the jigsaw-dev mailing list