Return-Path: X-Original-To: apmail-ant-dev-archive@www.apache.org Delivered-To: apmail-ant-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D75DD50D for ; Wed, 29 Aug 2012 15:43:29 +0000 (UTC) Received: (qmail 31388 invoked by uid 500); 29 Aug 2012 15:43:29 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 31329 invoked by uid 500); 29 Aug 2012 15:43:29 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 31321 invoked by uid 99); 29 Aug 2012 15:43:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2012 15:43:29 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=SPF_HELO_PASS,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of nicolas.lalevee@hibnet.org does not designate 216.86.168.183 as permitted sender) Received: from [216.86.168.183] (HELO mxout-08.mxes.net) (216.86.168.183) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2012 15:43:22 +0000 Received: from hibpro.home (unknown [90.21.245.196]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id EEBB150A65 for ; Wed, 29 Aug 2012 11:43:00 -0400 (EDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: Argument Processor "plugin" From: =?iso-8859-1?Q?Nicolas_Lalev=E9e?= In-Reply-To: Date: Wed, 29 Aug 2012 17:42:59 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <8AA69FB0-5879-4823-B106-F10C96A0AB21@hibnet.org> To: "Ant Developers List" X-Mailer: Apple Mail (2.1084) X-Virus-Checked: Checked by ClamAV on apache.org Le 29 ao=FBt 2012 =E0 16:41, Matt Benson a =E9crit : > Comments: >=20 > - 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 >=20 > Thanks, > Matt >=20 > On Wed, Aug 29, 2012 at 8:35 AM, Nicolas Lalev=E9e > wrote: >> I would like to add to Ant the possibility to define custom command = line options. >>=20 >> 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. >>=20 >> 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 :) >>=20 >> 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-experi= ment/argument-processor.patch >>=20 >> Nicolas >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org >> For additional commands, e-mail: dev-help@ant.apache.org >>=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org