You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Simone Tripodi <si...@apache.org> on 2011/12/26 22:35:29 UTC
[CLI] discuss experimental CLI binder APIs
Hi all guys,
I have been experimenting a new set of CLI APIs outside the ASF,
taking the best from existing CLI and some other non-ASF libraries,
mainly Cédric's JCommander[1], the purposes are:
* using fluent APIs;
* simplify the Options building;
* reducing the number of involved components;
* triggering actions when options are parsed;
A simple (not working) APIs usage can be found on the GitHub's space[2].
So, I would much more than happy to move the effort to [commons] and
donate the prototype, if people think it would be a worth give a try
to innovate [cli].
Otherwise, I will have to finalize it outside the ASF.
Feedbacks are welcome, many thanks in advance!
-Simo
[1] http://jcommander.org/
[2] http://s.apache.org/xS
http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [CLI] discuss experimental CLI binder APIs
Posted by Simone Tripodi <si...@apache.org>.
Hola Izio!
> Conversely, JCommander has a very low learning curve.
sure I'm JCommander user myself, but that are the reason why that
approach cannot universally applied
* it's not complete (yet) since it doesn't support Java-alike dynamic
options such as `-Dproperty=value` (they need to be collected in a
Properties/Map instance)
* it forces all parameters to be collected in POJOs - that is not
universally good (hey could be used to be passed in a pom.xml);
* it doesn't support Posix parser;
* wrong converters binding can be detected at runtime only - since
they are expressed in annotations, nothing can be done from the
compiler side;
* it would be useful performing blocking actions when detecting some
parameters, i.e. like --help that prints the usage message and exit;
* ... shall I continue? :)
> The example you provided is good enough, but it is still far away in terms
> of learning curve.
UH... Seriously? Being fluent-APIs should be at least easier of
current [cli] APIs...
Thanks for the feedbacks!
-Simo
http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [CLI] discuss experimental CLI binder APIs
Posted by Maurizio Cucchiara <mc...@apache.org>.
Hi Simone,
I don't know how others make use of CLI, what I'm going to discuss is only
my personal point of view.
I have to do with the command line stuff one time per project (more or
less), and I have to admit that the CLI api (even though is a good one) is
every time hard to apply. This is probably due the sporadic use.
Conversely, JCommander has a very low learning curve.
The example you provided is good enough, but it is still far away in terms
of learning curve.
Twitter :http://www.twitter.com/m_cucchiara
G+ :https://plus.google.com/107903711540963855921
Linkedin :http://www.linkedin.com/in/mauriziocucchiara
Maurizio Cucchiara
On 26 December 2011 22:35, Simone Tripodi <si...@apache.org> wrote:
> Hi all guys,
> I have been experimenting a new set of CLI APIs outside the ASF,
> taking the best from existing CLI and some other non-ASF libraries,
> mainly Cédric's JCommander[1], the purposes are:
>
> * using fluent APIs;
> * simplify the Options building;
> * reducing the number of involved components;
> * triggering actions when options are parsed;
>
> A simple (not working) APIs usage can be found on the GitHub's space[2].
>
> So, I would much more than happy to move the effort to [commons] and
> donate the prototype, if people think it would be a worth give a try
> to innovate [cli].
> Otherwise, I will have to finalize it outside the ASF.
> Feedbacks are welcome, many thanks in advance!
> -Simo
>
> [1] http://jcommander.org/
> [2] http://s.apache.org/xS
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>