ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Oldfield <Do...@STCG.net>
Subject RE: Exec args and quotes
Date Thu, 16 Nov 2000 21:43:35 GMT
Stefan,

In a previous reply you stated, "quotes will only be used in very rare
occasions." But from this reply - and from my experience - it seems that
quotes are always used with the 'value' attribute.

I can pretty much get around the problem using line instead of value, but
I'm still having trouble passing multi-word arguments. That may be the fault
of the app I'm trying to run (umldoc.exe - a javadoc/uml tool from
Togethersoft).

I tried passing escaped quotes to arg like so:

<arg line="-doctitle \"Multiple Word Document Title\"" />

but that blows up with:

F:\build.xml:124: Element type "arg" must be followed by either attribute
specifications, ">" or "/>".

Seems like <arg> should accept quoted characters.

I'm using ant 1.2 from 10/24/00.

Thanks,
Doug



 -----Original Message-----
From: 	Stefan Bodewig [mailto:bodewig@apache.org] 
Sent:	Thursday, November 16, 2000 08:07
To:	ant-user@jakarta.apache.org
Subject:	Re: Exec args and quotes

Javier Keller <jkeller@spm.de> wrote:

> I was having the same problem, and I manage to solve it using one
> element for each argument:
> 
> 	<exec executable="${home}/bin/isrenamestore.cmd">
> 		<arg value="-debug" />
> 		<arg value="-server=eCS" />
> 		<arg value="-oldStoreName=Store" />
> 	</exec>
> 
> All the following examples fail (under NT with JDK 1.3).
> 
> Example 1
> 	<exec executable="${home}/bin/isrenamestore.cmd">
> 		<arg value="-debug -server=eCS -oldStoreName=Store"/>
> 	</exec>
> 

here you are passing >>-debug -server=eCS -oldStoreName=Store<< as a
single argument (and as opposed to your working solution). Using

<arg line="-debug -server=eCS -oldStoreName=Store"/>

should work as well.

> Example 2 (without an equal sign in the attribute)
> 		<arg value="-debug -ldsjf"/>

same as above, using the line attribute instead of value should work.

> Example 3: (notice the whitespace in the attribute value)
> 		<arg value=" -debug -ldsjf"/>

and once again.

The difference between line and value is that Ant will pass the
argument to value to the command as an single argument, using quotes
to prevent it from being broken into tokens. The argument to line will
be split into tokens which are passed as separate arguments.

Do you think we could clarify the documentation of <arg> to explain
the difference between the line and value attributes? If so, do you
have a suggestion how to word that?

Stefan

Mime
View raw message