ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From javamz <jav...@yahoo.com>
Subject Re: Problem with command arguments
Date Sun, 18 Jan 2004 23:43:41 GMT
Thanks for the response....I am doing as you suggested, but what is happening is that I am
getting a single quote surrounding the argument value.  Here's an example of the command line
string that is being constructed:
 
pcli Run -Y Put -prS:\\PVCSCTRL\\APP_JAVA_FW -yf -nv '-m"My Description"' '-v"V6.2.0 RC2"'
-o -aC:\data\WSAD\WSADV5.1\CJF-BrioV3.1/MZTest -l -z /ProjectFolder/MZTest
 
Note the argument  '-m"MyDescription"'.  I need the double quotes are "My Description", but
I do not want the single quote surrounding the argument....and I cannot have a space after
the -m.    I have tried using both the setValue method and the setLine method, but none seem
to get me the result I need. Here is the code I am using to construct this command line argument:
 
 
 

/** 

* Set up the "Put" command using the supplied parameters. The

* following is an example of the command we are constructing:

* pcli Put -prS:\\PVCSCTRL\APP_JAVA_FW -vV6.2 RC2 -yf -nv -m"My change description" -v"My
Label" -z /MZTest

*/

commandLine.clearArgs();

commandLine.createArgument().setValue("Run");

log("TaskName: " + this.taskName);

commandLine.createArgument().setValue("-Y");



commandLine.createArgument().setValue((getExecutable(PUT_EXE)));

commandLine.createArgument().setValue("-pr" + getRepository());



commandLine.createArgument().setValue("-yf");



commandLine.createArgument().setValue("-nv");



if (getDescription() != null){

commandLine.createArgument().setValue("-m\"" + getDescription() + "\"");



} else {

throw new org.apache.tools.ant.BuildException("CignaPvcs:executePut - Missing Required attribute
'Description'...");

}

if (getLabel() != null) {

commandLine.createArgument().setValue("-v\"" + getLabel() + "\"");

} 



if (getWorkspace() != null) {

commandLine.createArgument().setLine("-o");

commandLine.createArgument().setLine("-a" + getWorkspace());

}



if (getBasepath() != null ) {

commandLine.createArgument().setValue("-bp");

commandLine.createArgument().setLine("\"" + getBasepath() +"\"");

} 



if (getLock() != null && getLock().equalsIgnoreCase("true")) {

commandLine.createArgument().setValue("-l"); 

}



commandLine.createArgument().setValue("-z");



if (getPvcsproject() != null) {

commandLine.createArgument().setLine(getPvcsproject());

}



log("Checking in files", Project.MSG_INFO);

log("Executing " + commandLine.toString(), Project.MSG_INFO);



result = runCmd(commandLine, new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN));

 

 


Thomas Schapitz <Thomas.Schapitz@ePost.de> wrote:
Ahh...

sorry, I missed the three letters API....
but even then, Antoines suggestion should be turned into
...
arg1.setValue("-m\"My Description\"");
...
Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message