Command line: Run single command on multiple files

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
beaudetious
Posts: 3
Joined: Fri Oct 29, 2010 10:59 am

Command line: Run single command on multiple files

Post by beaudetious » Fri Oct 29, 2010 11:05 am

I would like to run the command line Label on multiple files at one time. Is this possible:

vault.exe -host label "file1.txt, file2.png, file3.zip" NewLabel1

Or is there some other syntax for this?

SourceGear Vault client version 4.1.4

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line: Run single command on multiple files

Post by Beth » Fri Oct 29, 2010 1:31 pm

This currently isn't possible. If you don't want to type all the information multiple times you could either use the RememberLogin command first, or create a batch file so that all you have to do is change the file name of what you want labeled.

Another option is to label at the folder level and through inheritance, each file gets covered by that label.
Beth Kieler
SourceGear Technical Support

beaudetious
Posts: 3
Joined: Fri Oct 29, 2010 10:59 am

Re: Command line: Run single command on multiple files

Post by beaudetious » Fri Oct 29, 2010 2:09 pm

Beth wrote:This currently isn't possible.
Well, that explains why VisualBuildPro was barfing on my command. :)

Thanks,

Beaudetious

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line: Run single command on multiple files

Post by Beth » Fri Oct 29, 2010 3:12 pm

Here's a KB article that may help you some with what you need to do: How to label as part of a build script
Beth Kieler
SourceGear Technical Support

beaudetious
Posts: 3
Joined: Fri Oct 29, 2010 10:59 am

Re: Command line: Run single command on multiple files

Post by beaudetious » Mon Nov 01, 2010 7:47 am

Thanks for the pointer Beth. Visual Build Pro has unique actions for working with Vault that implement many of the commands required to integrate with Vault including the Label and GetLabel commands. The main problem was that their interface leads one to believe they can add multiple paths/filenames to the Label command. In reality, Vault throws an error because it can't handle more than one file/path per Label command.

Image

My workaround, at this time, is to just create a separate action item for each file/path I need to label. Per your initial response, I could easily just label a directory (which we do for some of our work) but in this particular case, I have some files in the same directory that are not to be labeled.

I'll rethink my strategy and reconsider moving those files to another non-labeled directory but for now the multiple action steps are working fine.

Thanks for your insight.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line: Run single command on multiple files

Post by Beth » Mon Nov 01, 2010 9:09 am

Thank you for the update. I'm sure other users may find this helpful.
Beth Kieler
SourceGear Technical Support

Post Reply