Felice,
Separate <arg> elements allows NAnt to
- resolve relative to absolute file paths (when using "file" attribute)
- take care of quoting if necessary (when using "value", "file" or "path" attribute)
- conditionally pass certain arguments to the executable (using "if" and "unless" attributes)
- automatically expand environment variables (when using the "path" attribute)
- ....
Gert
----- Original Message ----- From: "Felice Vittoria" <[EMAIL PROTECTED]>
To: "Gert Driesen" <[EMAIL PROTECTED]>; "Skip Sailors" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, September 20, 2004 5:56 PM
Subject: RE: [Nant-users] RE: containing " in value ([EMAIL PROTECTED])
Gert,
You said: In the spirit of XML, wouldn't it be reasonable to expect that we could write: <exec program="mkdir" commandline=""c:\temp\test 1""/>
That should ofcourse be possible too, but I'd advise against using the commandline attribute and use the nested <arg> elements instead.
You can use the "line" attribute of the <arg> element if you want to control quoting yourself. For example :
<exec program="mkdir"> <arg line=""c:\temp\test 1""/> </exec>
Question: JOOC, Why do you advise against using the commandline attribute?
Thanks, Felice
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Gert Driesen Sent: Monday, September 20, 2004 10:36 AM To: Skip Sailors; [EMAIL PROTECTED] Subject: Re: [Nant-users] RE: containing " in value ([EMAIL PROTECTED])
----- Original Message ----- From: "Skip Sailors" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 20, 2004 5:26 PM
Subject: [Nant-users] RE: containing " in value ([EMAIL PROTECTED])
>1. containing " in value ([EMAIL PROTECTED])
... Today's Topics:
:... Message: 1 To: [EMAIL PROTECTED] From: [EMAIL PROTECTED] Date: Fri, 17 Sep 2004 18:41:39 -0400 Subject: [Nant-users] containing " in value ... Hi there,
How can I include " in a value?
ex: mkdir "c:\temp\test 1"
how to make up the commandline?
<exec program="mkdir" commandline=????? />
Thx
... --__--__--
Message: 2 From: "Gert Driesen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> Subject: Re: [Nant-users] containing " in value Date: Sun, 19 Sep 2004 12:37:39 +0200
Hi,
I've just made some modifications with regards to command line arguments. In the next 0.85 nightly build, you'll have the following options
will be
1. use the "value" attribute of the <arg> element. The value
will behandled as a single command line argument.
for example :
<exec program="mkdir"> <arg value="c:\temp\test 1" /> </exec>
=> mkdir "c:\temp\test 1"
2. use the "path" attribute of the <arg> element. The value
handled as a : or ; separated list of paths. Individual parts will be converted to an absolute path (resolved relative to project base directory).
for example :
<exec program="mkdir"> <arg path="test 1" /> </exec>
=> mkdir "<project base dir>\test 1"
Hope this helps,
Gert ...
In the spirit of XML, wouldn't it be reasonable to expect that we could write: <exec program="mkdir" commandline=""c:\temp\test 1""/>
That should ofcourse be possible too, but I'd advise against using the commandline attribute and use the nested <arg> elements instead.
You can use the "line" attribute of the <arg> element if you want to control quoting yourself. For example :
<exec program="mkdir"> <arg line=""c:\temp\test 1""/> </exec>
This is only available in yesterday's nightly build (if I'm not mistaken).
Hope this helps,
Gert
------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users
------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users
------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users