ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <anto...@antbuild.com>
Subject Re: Problem with command arguments
Date Mon, 19 Jan 2004 07:43:59 GMT
javamz wrote:

>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
>
>
>  
>
I am not a PVCS expert, but I would assume that -m should be a separate 
argument; then it is enough if your message is another separate argument.
The single quotes are only part of the debug output of ant.
ant is starting your application with an array of arguments.
Cheers,
Antoine

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


Mime
View raw message