Commandline is documented as: The command-line arguments for the program. The syntax is:
<exec program="ruby" commandline="script.rb arg1 arg2 arg3"/>Using exec and commandline should be the same as executing the following statement at a command line.
$ ruby script.rb arg1 arg2 arg3Arg is documented as: The command-line arguments for the external program. The syntax is:
<exec program="ruby">Using exec and arg should be the same as executing the following statement at a command line.
<arg value="script.rb"/>
<arg value="arg1"/>
<arg value="arg2"/>
<arg value="arg3"/>
</exec>
$ ruby "script.rb" "arg1" "arg2" "arg3"Obviously, the difference is that arg adds quotes around the arguments. This may seem like a small issue, but I've seen time wasted on this minor difference. The most common problematic scenario occurs when someone tries to combine multiple args into one arg tag.
<exec program="ruby">The problem with the above example is that it is the same as executing the following statement at a command line.
<arg value="script.rb arg1 arg2 arg3"/>
</exec>
$ ruby "script.rb arg1 arg2 arg3"This won't work in a build and at the command line it would produce:
ruby: No such file or directory -- script.rb arg1 arg2 arg3 (LoadError)Using commandline or arg is likely a matter of personal preference as long as you are educated on the differences.