Command line - bath mode - batch file
Moderator: SourceGear
Command line - bath mode - batch file
Hello guys! I am working on a app that via command line pulls some files with a specific version. I already did some tests using a batch file which are working perfect. I am just curious if there is a way to specify comments in the batch file. The following is to be able to separate by change number which versions and files it is using. Something like:
#change1
version file
version file
#change2
version file
version file
Thanks for your help!
#change1
version file
version file
#change2
version file
version file
Thanks for your help!
Re: Command line - bath mode - batch file
There isn't anything built into our command line to format the output, but you could redirect the output to a file, then parse that file and add in comments I think.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Command line - bath mode - batch file
Yes.. that is what intend to do. I already tested the batch file containing versions and files just like what I mentioned in the first post.Beth wrote:There isn't anything built into our command line to format the output, but you could redirect the output to a file, then parse that file and add in comments I think.
I guess what I am trying to do is add comments to the batch file used when doing vault.exe BATCH filename but I ignore how to add comments to the batch file. How can I indicate in the batch file that a line is a comment?
Re: Command line - bath mode - batch file
You can try starting the line with REM.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Command line - bath mode - batch file
I test that with my batch file. I must mention that at first, the batch file I was using was a simple text (.txt) file so the REM did not work. So I then changed the text file to a .bat and it did not work either.Beth wrote:You can try starting the line with REM.
This is how the contents of the batch file I am using look like. If I get rid of the REM start line, it all works fine either with .txt or .bat
REM start
getversion 3 $/Vault/log4.txt c:/vault
getversion 1 $/Vault/log5.txt c:/vault
getversion 2 $/Vault/log6.txt
Re: Command line - bath mode - batch file
I'm not sure what you mean by it doesn't work. Were you wanting it printed out? A line with REM at the start should be ignored.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Command line - bath mode - batch file
Oops. Even though we included a BATCH command in the vault command line, our brains immediately switched to MS-DOS mode.
Unfortunately, the file that you pass with "vault BATCH filename" must consist of vault commands, and there is no provision for "comments," or ignored lines. This feature is intended as a convenience for grouping related commands together, but it's not a full-blown scripting function.
Blank lines are ignored, so you can use them to set groups of commands apart from each other, but there's no real way to identify sections using comment lines.
Unfortunately, the file that you pass with "vault BATCH filename" must consist of vault commands, and there is no provision for "comments," or ignored lines. This feature is intended as a convenience for grouping related commands together, but it's not a full-blown scripting function.
Blank lines are ignored, so you can use them to set groups of commands apart from each other, but there's no real way to identify sections using comment lines.
Joe Ream
SourceGear Technical Support
SourceGear Technical Support
Re: Command line - bath mode - batch file
Yes that is what I meant, sorry for not expressing my question correctly. Too bad this can't be done. Thanks for your support.joe_sg wrote:Oops. Even though we included a BATCH command in the vault command line, our brains immediately switched to MS-DOS mode.
Unfortunately, the file that you pass with "vault BATCH filename" must consist of vault commands, and there is no provision for "comments," or ignored lines. This feature is intended as a convenience for grouping related commands together, but it's not a full-blown scripting function.
Blank lines are ignored, so you can use them to set groups of commands apart from each other, but there's no real way to identify sections using comment lines.
Re: Command line - bath mode - batch file
I can enter in a feature request if you'd like.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Command line - bath mode - batch file
I guess someone else might found that helpful. Adding comments in batch files can help you identifying and explaining exactly what you are doing in it.Beth wrote:I can enter in a feature request if you'd like.
Re: Command line - bath mode - batch file
I've entered a request. Thank you for bringing this up.
F: 15602
F: 15602
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support