You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@any23.apache.org by Simone Tripodi <si...@apache.org> on 2012/01/17 14:47:41 UTC

CLI evaluator

Hi all/Michele,

while reading the core source, I noticed that CLI is managed via the
outdated commons-cli, I tried to replaced it with something more
sophisticated like JCommander[1] (ASL2.0) but I stopped as soon as I
started because I noticed the code uses custom annotations, so worried
about breaking something, I gave up.

My question is: can you give me please a little of background about
the CLI design?
Any hint/help would be really appreciated!
Many thanks in advance, all the best!
-Simo

[1] http://jcommander.org/

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

Re: CLI evaluator

Posted by Simone Tripodi <si...@apache.org>.
Hi all,
I gave a (very) quick try but after have broken the any23 behavior, I
gave up and rolled back my local changes :(
Let's keep things working as they are ATM - at least they work! - and
rethink about how to re-engineering them after the first release ;)
All the best,
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Wed, Jan 18, 2012 at 8:58 AM, Simone Tripodi
<si...@apache.org> wrote:
> Hi Mic,
> thanks a lot for the hints, I'll try to give an experiment as soon as
> I have the chance - I'll keep track of the activity on an issue with
> patches, to avoid to break the current behavior.
> All the best!
> -Simo
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
>
>
> On Tue, Jan 17, 2012 at 5:48 PM, Michele Mostarda
> <mi...@gmail.com> wrote:
>> On 17 January 2012 14:47, Simone Tripodi <si...@apache.org> wrote:
>>
>>> Hi all/Michele,
>>>
>>
>> Hi Guys,
>>
>>>
>>> while reading the core source, I noticed that CLI is managed via the
>>> outdated commons-cli, I tried to replaced it with something more
>>> sophisticated like JCommander[1] (ASL2.0) but I stopped as soon as I
>>> started because I noticed the code uses custom annotations, so worried
>>> about breaking something, I gave up.
>>>
>>> My question is: can you give me please a little of background about
>>> the CLI design?
>>>
>>
>> Well, any org.apache.any23.cli.Tool implementation provides a static void
>> main(String[])
>> access point which allows to run it directly.
>>
>> There is however a special CLI tool called org.apache.any23.cli.ToolRunner
>> which takes
>> care to detect all the CLI Tool implementations declared within the class
>> path
>> (asking also to the PluginManager) and drive an 'assisted' invocation.
>>
>> The invocation of org.apache.any23.cli.ToolRunner without parameters will
>> list all the
>> available Tools. To invoke a specific Tool just run:
>>
>> org.apache.any23.cli.ToolRunner <tool-class-simple-name>
>> [<specific-tool-params>]
>>
>> The replacement of commons-cli with another options parsing library will
>> not interfere
>> with the custom annotations applied to the org.apache.any23.cli.Tool
>> instances in any way.
>>
>> Let me know if you need any further explanation.
>>
>> Bye
>>
>> Mic
>>
>>
>>> Any hint/help would be really appreciated!
>>> Many thanks in advance, all the best!
>>> -Simo
>>>
>>> [1] http://jcommander.org/
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://simonetripodi.livejournal.com/
>>> http://twitter.com/simonetripodi
>>> http://www.99soft.org/
>>>
>>
>>
>>
>> --
>> Michele Mostarda
>> Senior Software Engineer
>> skype: michele.mostarda
>> twitter: micmos
>> mail: me@michelemostarda.com
>> site : http://www.michelemostarda.com

Re: CLI evaluator

Posted by Simone Tripodi <si...@apache.org>.
Hi Mic,
thanks a lot for the hints, I'll try to give an experiment as soon as
I have the chance - I'll keep track of the activity on an issue with
patches, to avoid to break the current behavior.
All the best!
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Tue, Jan 17, 2012 at 5:48 PM, Michele Mostarda
<mi...@gmail.com> wrote:
> On 17 January 2012 14:47, Simone Tripodi <si...@apache.org> wrote:
>
>> Hi all/Michele,
>>
>
> Hi Guys,
>
>>
>> while reading the core source, I noticed that CLI is managed via the
>> outdated commons-cli, I tried to replaced it with something more
>> sophisticated like JCommander[1] (ASL2.0) but I stopped as soon as I
>> started because I noticed the code uses custom annotations, so worried
>> about breaking something, I gave up.
>>
>> My question is: can you give me please a little of background about
>> the CLI design?
>>
>
> Well, any org.apache.any23.cli.Tool implementation provides a static void
> main(String[])
> access point which allows to run it directly.
>
> There is however a special CLI tool called org.apache.any23.cli.ToolRunner
> which takes
> care to detect all the CLI Tool implementations declared within the class
> path
> (asking also to the PluginManager) and drive an 'assisted' invocation.
>
> The invocation of org.apache.any23.cli.ToolRunner without parameters will
> list all the
> available Tools. To invoke a specific Tool just run:
>
> org.apache.any23.cli.ToolRunner <tool-class-simple-name>
> [<specific-tool-params>]
>
> The replacement of commons-cli with another options parsing library will
> not interfere
> with the custom annotations applied to the org.apache.any23.cli.Tool
> instances in any way.
>
> Let me know if you need any further explanation.
>
> Bye
>
> Mic
>
>
>> Any hint/help would be really appreciated!
>> Many thanks in advance, all the best!
>> -Simo
>>
>> [1] http://jcommander.org/
>>
>> http://people.apache.org/~simonetripodi/
>> http://simonetripodi.livejournal.com/
>> http://twitter.com/simonetripodi
>> http://www.99soft.org/
>>
>
>
>
> --
> Michele Mostarda
> Senior Software Engineer
> skype: michele.mostarda
> twitter: micmos
> mail: me@michelemostarda.com
> site : http://www.michelemostarda.com

Re: CLI evaluator

Posted by Michele Mostarda <mi...@gmail.com>.
On 17 January 2012 14:47, Simone Tripodi <si...@apache.org> wrote:

> Hi all/Michele,
>

Hi Guys,

>
> while reading the core source, I noticed that CLI is managed via the
> outdated commons-cli, I tried to replaced it with something more
> sophisticated like JCommander[1] (ASL2.0) but I stopped as soon as I
> started because I noticed the code uses custom annotations, so worried
> about breaking something, I gave up.
>
> My question is: can you give me please a little of background about
> the CLI design?
>

Well, any org.apache.any23.cli.Tool implementation provides a static void
main(String[])
access point which allows to run it directly.

There is however a special CLI tool called org.apache.any23.cli.ToolRunner
which takes
care to detect all the CLI Tool implementations declared within the class
path
(asking also to the PluginManager) and drive an 'assisted' invocation.

The invocation of org.apache.any23.cli.ToolRunner without parameters will
list all the
available Tools. To invoke a specific Tool just run:

org.apache.any23.cli.ToolRunner <tool-class-simple-name>
[<specific-tool-params>]

The replacement of commons-cli with another options parsing library will
not interfere
with the custom annotations applied to the org.apache.any23.cli.Tool
instances in any way.

Let me know if you need any further explanation.

Bye

Mic


> Any hint/help would be really appreciated!
> Many thanks in advance, all the best!
> -Simo
>
> [1] http://jcommander.org/
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>



-- 
Michele Mostarda
Senior Software Engineer
skype: michele.mostarda
twitter: micmos
mail: me@michelemostarda.com
site : http://www.michelemostarda.com