commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LeVan,Ralph" <le...@oclc.org>
Subject Re: [CLI] Configure Options from usage statement??
Date Fri, 10 Jul 2015 11:31:50 GMT
Optionals are marked by brackets, as in the example. Help text could be provided as text in
parens after the parameter declaration. I don't do that currently (if JSAP had that capability,
I never noticed), so if you'd like to propose another mechanism I'd be happy to consider it.

Ralph



On Thu, Jul 9, 2015 at 10:41 PM -0700, "Benedikt Ritter" <britter@apache.org<mailto:britter@apache.org>>
wrote:

Hello Ralph,

2015-07-09 22:25 GMT+02:00 LeVan,Ralph <levan@oclc.org>:

> My apologies if I'm going about this wrong.
>
> Several years ago I wrote a layer on top of JSAP to configure its parser
> from a simple usage statement.  I tried to push that code back to the
> developer, with no success.  I'd like to see that code get into production
> somewhere so I can stop using my private fork.
>
> For JSAP, configuration turned into this:
>         SimplerJSAP jsap = new SimplerJSAP("dbname [--taglist<String>]
> [--alternativeTagpaths<File>]");
>         JSAPResult config = jsap.parse(args);
>
> This is much simpler and much much more readable than the JSAP code and it
> looks to me like the CLI version is just as complicated.
>
> Would there be any interest in me contributing such a layer on top of CLI?
>

Interesting. This certainly only works for simple CLIs. How would you
handle mandatory vs. optional options? And how can a help text be added
with this API?

Benedikt


>
> Thanks!
>
> Ralph
>
> --
>
> Ralph LeVan
>
> OCLC * Senior Research Scientist, OCLC Research
>
> 6565 Kilgour Place, Dublin, Ohio USA 43017
>
> T +1-614-764-6115
>
> [OCLC]<http://www.oclc.org/home.en.html?cmpid=emailsig_logo>
>
> OCLC.org<http://www.oclc.org/home.en.html?cmpid=emailsig_link> * Facebook<
> http://www.facebook.com/pages/OCLC/20530435726> * Twitter<
> http://twitter.com/oclc> * YouTube<http://www.youtube.com/OCLCvideo>
>
>
>


--
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message