You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Vinodh Kumar <vi...@gmail.com> on 2011/11/29 17:32:51 UTC

Multiple Arguments Validation

Hi,

I have validation scenario of comparing user input match. But how can I
match mulitple args in single condition [I don't want to use multiple
else/if conditions]

If user input matches any one of the values from key dep.env, echos success.

*Ant Scriplet:*
<if>
<equals arg1=&quot;&lt;&lt;USER_INPUT>>" arg2="${dep.env}"/>
<then>
<echo message="Environment Exists"/>
</then>
<else>
<fail message="Environment Exists"/>
</else>
</if>

*Property file:*

dep.env=IT1,IT2,IT3,IT4,IT5,IT9,QA1,QA2,QA3,QA4,QA5,QA6,Prod


--Vinodh

--
View this message in context: http://ant.1045680.n5.nabble.com/Multiple-Arguments-Validation-tp5032934p5032934.html
Sent from the Ant - Users mailing list archive at Nabble.com.

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


Re: Multiple Arguments Validation

Posted by Parag Doke <pa...@gmail.com>.
Hi Vinodh.
Have you tried the contains or matches conditions ? I believe (haven't
tried yet) what you are trying to achieve is doable using those.
Refer link: http://ant.apache.org/manual/Tasks/conditions.html

Hope this helps,
Parag Doke
Save paper, save trees. Do not print emails/documents unless absolutely
necessary.


On Tue, Nov 29, 2011 at 10:02 PM, Vinodh Kumar <vi...@gmail.com> wrote:

> Hi,
>
> I have validation scenario of comparing user input match. But how can I
> match mulitple args in single condition [I don't want to use multiple
> else/if conditions]
>
> If user input matches any one of the values from key dep.env, echos
> success.
>
> *Ant Scriplet:*
> <if>
> <equals arg1=&quot;&lt;&lt;USER_INPUT>>" arg2="${dep.env}"/>
> <then>
> <echo message="Environment Exists"/>
> </then>
> <else>
> <fail message="Environment Exists"/>
> </else>
> </if>
>
> *Property file:*
>
> dep.env=IT1,IT2,IT3,IT4,IT5,IT9,QA1,QA2,QA3,QA4,QA5,QA6,Prod
>
>
> --Vinodh
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Multiple-Arguments-Validation-tp5032934p5032934.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>