You are viewing a plain text version of this content. The canonical link for it is here.
Posted to easyant-commits@incubator.apache.org by "Jean-Louis Boudart (JIRA)" <ji...@apache.org> on 2011/07/20 15:15:56 UTC

[jira] [Commented] (EASYANT-30) Refactor EasyAnt main class to use commons-cli

    [ https://issues.apache.org/jira/browse/EASYANT-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068429#comment-13068429 ] 

Jean-Louis Boudart commented on EASYANT-30:
-------------------------------------------

Link to Apache commons-cli http://commons.apache.org/cli/

> Refactor EasyAnt main class to use commons-cli
> ----------------------------------------------
>
>                 Key: EASYANT-30
>                 URL: https://issues.apache.org/jira/browse/EASYANT-30
>             Project: EasyAnt
>          Issue Type: Improvement
>            Reporter: Jean-Louis Boudart
>
> We originally forked the Ant's main class to add our options (as the original class was not fully designed to be extends for our needs).
> Then we started implementing new kind of command line switches and called it ManCommands. Thoses ManCommands were designed to make complex features accessible from the commande line like:
> * listTargets : Lists all targets available
> * listTargets [arg] : Lists all targets associated with the specified phase / plugin as argument
> * listPhases : Lists all phases available
> * listPugins : Lists all plugins imported in the current project
> * listProps [plugin] : Lists all properties available in the specified plugin
> * describe [arg] : Describes a phase / target / property specified by argument
> To create new "mancomands" you were obligated to implements ManCommand interface, modify easyant main to "handle" the new switch and modify the usage.
> My concern is about maintenance of "usage" section it was never updated.
> I would suggest to refactor our main class and use an apache library => commons-cli.
> As main advantages, i see "usage" or help generator, an easier and stronger mechanism for parameter handling. 
> Commons cli support :
>     POSIX like options (ie. tar -zxvf foo.tar.gz)
>     GNU like long options (ie. du --human-readable --max-depth=1)
>     Java like properties (ie. java -Djava.awt.headless=true -Djava.net.useSystemProxies=true Foo)
>     Short options with value attached (ie. gcc -O2 foo.c)
>     long options with single hyphen (ie. ant -projecthelp)
> As a minor drawback easyant-core will have one more dependency, but if this is a real problem we could split easyant-core in two distinct module "core", and "cli" where "cli" will containing the main class "ManCommand" and the dependency on Apache commons-cli.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira