<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- Documenting T:NAnt.Core.Types.Argument--> <head> <meta http-equiv="Content-Language" content="en-ca" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="../style.css" /> <title><arg> Element</title> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar"> <tr> <td class="NavBar-Cell"> <a href="http://nant.sourceforge.net"> <b>NAnt</b> </a> <img alt="->" src="../images/arrow.gif" /> <a href="../index.html">Help</a> <img alt="->" src="../images/arrow.gif" /> <span>Element Reference</span> <img alt="->" src="../images/arrow.gif" /> <arg></td> <td class="NavBar-Cell" align="right"> v0.90</td> </tr> </table> <h1><arg></h1> <p> Represents a command-line argument. </p> <p> When passed to an external application, the argument will be quoted when appropriate. This does not apply to the <code>line</code> parameter, which is always passed as is. </p> <h3>Parameters</h3> <div class="table"> <table> <tr> <th>Attribute</th> <th style="text-align: center;">Type</th> <th>Description</th> <th style="text-align: center;">Required</th> </tr> <tr> <td valign="top">dir</td> <td style="text-align: center;">directory</td> <td> The value for a directory-based command-line argument; will be replaced with the absolute path of the directory. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">file</td> <td style="text-align: center;">file</td> <td> The name of a file as a single command-line argument; will be replaced with the absolute filename of the file. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">if</td> <td style="text-align: center;">bool</td> <td> Indicates if the argument should be passed to the external program. If <b>true</b> then the argument will be passed; otherwise, skipped. The default is <b>true</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">line</td> <td style="text-align: center;">string</td> <td> List of command-line arguments; will be passed to the executable as is. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">path</td> <td style="text-align: center;"><path></td> <td> The value for a PATH-like command-line argument; you can use <code>:</code> or <code>;</code> as path separators and NAnt will convert it to the platform's local conventions, while resolving references to environment variables. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">unless</td> <td style="text-align: center;">bool</td> <td> Indicates if the argument should not be passed to the external program. If <b>false</b> then the argument will be passed; otherwise, skipped. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">value</td> <td style="text-align: center;">string</td> <td> A single command-line argument; can contain space characters. </td> <td style="text-align: center;">False</td> </tr> </table> </div> <h3>Nested Elements:</h3> <!--Element--> <h4> <a id="path"> </a> <<a href="../types/path.html">path</a>> </h4> <div class="nested-element"> Sets a single command-line argument and treats it like a PATH - ensures the right separator for the local platform is used. <p /></div> <h4> <a id="path"> </a> </<a href="../types/path.html">path</a>> </h4> <h3>Examples</h3> <ul class="examples"> <li> <p> A single command-line argument containing a space character. </p> <pre class="code"> <arg value="-l -a" /> </pre> </li> <li> <p> Two separate command-line arguments. </p> <pre class="code"> <arg line="-l -a" /> </pre> </li> <li> <p> A single command-line argument with the value <code>\dir;\dir2;\dir3</code> on DOS-based systems and <code>/dir:/dir2:/dir3</code> on Unix-like systems. </p> <pre class="code"> <arg path="/dir;/dir2:\dir3" /> </pre> </li> </ul> <h3>Requirements</h3> <div style="margin-left: 20px;"> <b>Assembly:</b> NAnt.Core (0.90.3780.0) </div> </body> </html>