ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Lalevée <nicolas.lale...@hibnet.org>
Subject Re: Argument Processor "plugin"
Date Wed, 29 Aug 2012 15:42:59 GMT

Le 29 août 2012 à 16:41, Matt Benson a écrit :

> Comments:
> 
> - ArgumentProcessor#readArgument() should return a negative number for
> unsupported args, otherwise a separate boolean #supports(arg) method
> and a declared IllegalArgumentException from #readArgument()

Reviewing this, maybe a better method would be:
int readArgument(String[] args, int pos);
which returns the new position, the same as the one provided is not supported.
That way we can have a variable number of custom arguments.

> - Prefer e.g. Appendable to StringBuffer in
> ArgumentProcessor#printUsage() signature, or unless there is a good
> reason for the configurable line separator, PrintStream or PrintWriter

Actually, in the current implementation, any reason all the message is buffered before being
put to System.out ?
Any reason not to do System.out.println rather than StringBuffer.append( + line.separator)
?

> I am generally in favor of the idea, so as long as the APIs are as
> nice as they can be all the internals are negotiable.

Thanks for the review,
Nicolas

> 
> Thanks,
> Matt
> 
> On Wed, Aug 29, 2012 at 8:35 AM, Nicolas Lalevée
> <nicolas.lalevee@hibnet.org> wrote:
>> I would like to add to Ant the possibility to define custom command line options.
>> 
>> This is motivated by the experiment I am doing with the AntDSL and the import model
I am trying to revisit (if anybody is interested, at some point I will probably discuss it
on easyant-dev, but we can also discuss here). I want things to happen before the build file
is being parsed and I want it to happen only if the end user has requested it.
>> 
>> I have not committed it because it is a kind of important door opening in Ant's API.
And it is only required by an experiment. EasyAnt has some custom arguments too, it could
benefit from it, but for now it has it own "main" implementation and so has a full control
of argument parsing. So there is no real use case. yet :)
>> 
>> So I would like some feed back before proceeding. The suggested patch is here:
>> https://svn.apache.org/repos/asf/ant/sandbox/antdsl/branches/import-experiment/argument-processor.patch
>> 
>> Nicolas
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message