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 4250ED597 for ; Wed, 29 Aug 2012 16:44:36 +0000 (UTC) Received: (qmail 64452 invoked by uid 500); 29 Aug 2012 16:44:36 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 64410 invoked by uid 500); 29 Aug 2012 16:44:36 -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 64402 invoked by uid 99); 29 Aug 2012 16:44:36 -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 16:44:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gudnabrsam@gmail.com designates 209.85.212.45 as permitted sender) Received: from [209.85.212.45] (HELO mail-vb0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2012 16:44:30 +0000 Received: by vbip1 with SMTP id p1so789521vbi.4 for ; Wed, 29 Aug 2012 09:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=U84/ktSMAYPz7Yvst7YXuuDhFkvRyC/Xph+HeKI1gRw=; b=MECSRHmzjGf18616aTkA1IXIs5nRBXuEnLOvVPG4GsTM68ZnaUZnnaqRqPNLJajT5S BRiPOJRDs6dLE0CzO22hfZyChjDG6lkJKUuR3qe+NuZmn56k6kA4PnGSHz20nohUqAUZ 2t++2LFJ1O3u17Y+J0lx/ts7MuVM4FSfmIf8es1XIjeTksYwAk5OZSZxSLXEoOisfO3L v6iaR9eSnSWyRTw+VGbuu59rHXNV7Ds4pjNOnut7PkANnrm7ny/l99yHJ+8N/cDuRrmt jOS3E5j+eeKkNTij+eEE96k4DJ739zhzzJFUZ3kdO0JWepFbhmZT2l1cxD4OjsKCt6ez 3qiQ== MIME-Version: 1.0 Received: by 10.220.242.73 with SMTP id lh9mr1504268vcb.4.1346258649982; Wed, 29 Aug 2012 09:44:09 -0700 (PDT) Received: by 10.58.28.135 with HTTP; Wed, 29 Aug 2012 09:44:09 -0700 (PDT) Reply-To: gudnabrsam@gmail.com In-Reply-To: References: <8AA69FB0-5879-4823-B106-F10C96A0AB21@hibnet.org> Date: Wed, 29 Aug 2012 11:44:09 -0500 Message-ID: Subject: Re: Argument Processor "plugin" From: Matt Benson To: Ant Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Aug 29, 2012 at 10:42 AM, Nicolas Lalev=E9e wrote: > > Le 29 ao=FBt 2012 =E0 16:41, Matt Benson a =E9crit : > >> 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 suppo= rted. > That way we can have a variable number of custom arguments. Sounds good. Reminds me of ParsePosition etc. > >> - 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 bu= ffered before being put to System.out ? > Any reason not to do System.out.println rather than StringBuffer.append( = + line.separator) ? Not sure, but using PrintStream would allow Ant Main to have the ArgumentProcessor write directly to System.out or not. :D Matt > >> 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=E9e >> wrote: >>> I would like to add to Ant the possibility to define custom command lin= e 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 poin= t 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 i= t 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 cu= stom arguments too, it could benefit from it, but for now it has it own "ma= in" 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 i= s here: >>> https://svn.apache.org/repos/asf/ant/sandbox/antdsl/branches/import-exp= eriment/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 > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org