ANT arg value 与arg line的区别

Command-line Arguments
Several tasks take arguments that will be passed to another process on the command line. To make it easier to specify arguments that contain space characters, nested arg elements can be used.

Attribute Description Required
value a single command-line argument; can contain space characters. Exactly one of these.
file The name of a file as a single command-line argument; will be replaced with the absolute filename of the file.
path A string that will be treated as a path-like string as a single command-line argument; you can use ; or : as path separators and Ant will convert it to the platform's local conventions.
pathref Reference to a path defined elsewhere. Ant will convert it to the platform's local conventions.
line a space-delimited list of command-line arguments.

It is highly recommended to avoid the line version when possible. Ant will try to split the command line in a way similar to what a (Unix) shell would do, but may create something that is very different from what you expect under some circumstances.

Examples
<arg value="-l -a"/>
is a single command-line argument containing a space character, not separate commands "-l" and "-a".

<arg line="-l -a"/>
This is a command line with two separate arguments, "-l" and "-a".

<arg path="/dir;/dir2:\dir3"/>
is a single command-line argument with the value \dir;\dir2;\dir3 on DOS-based systems and /dir:/dir2:/dir3 on Unix-like systems.

例子
<arg value="-l -a"/>
是一个含有空格的单个的命令行变量。
<arg line="-l -a"/>
是两个空格分隔的命令行变量。


value 一个命令行变量;可包含空格字符。 但是整体的作为一个变量传给程序
line 空格分隔的命令行变量列表。


据我个人的经验,目前为止,还没有必须要用arg value的情况.反而是很多参数需要传进去.这个时候如果用arg value会报错的.所以我一般情况下都是用的arg line


其实value与line没有本质的区别
value无非是把每个参数的意义
更加细化而已
而 line把所有的参数整合成一个而已

从使用来说,使用line出错的概率比较低


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值