ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: Problem with command arguments
Date Mon, 19 Jan 2004 12:13:18 GMT
michelle zaremskas wrote:

>I have an Ant task that I am writing which is invoking a Windows Command Line program.
An example of the string I am attempting to contruct is:
>pcli Put -prd:\pvcs\vm\sampledb aC:\test -o -m "My Description"  -v"My Version label"
bp/chess/server /chess/server/server.bat /chess/server/shutdown.txt
The following should work:

<exec executable="pcli">
  <arg value="Put"/>
  <arg value="-prd:\pvcs\vm\sampledb"/>
  <arg value="aC:\test"/> <!-- or "-aC:\test" ? -->
  <arg value="-o"/>
  <arg value="-m"/>
  <arg value="My Description"/> <!-- on windows java.lang.Runtime#Exec() will put
" around this -->
  <arg value="-v"/>
  <arg value="My Version label"/>
  <arg value="bp/chess/server"/>

The ant api would follow the above:
    execTask = project.createTask("exec");
     Commandline.Argument arg;
    arg = execTask.createArg();
    arg = execTask.createArg();
    arg = execTask.createArg();
    arg = execTask.createArg();
    arg.setValue("My Description")



>The problem is I am having is that the command line executable will not allow a "space"
after the -m parameter and it requires double quotes around the value I am passing.  When
I attempt to construct the Command Argument using the ANT API it will either place a space
after the '-m' parameter or it will place double quotes around the string like so:  "-mMy
>Can someone provide me some guidance on how I can correctly construct this string using
the Ant API for my ANT task.
>Do you Yahoo!?
>Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message