1

I am using RTC CLI to get the list of source files of a single component in a Repository Workspace. My script looks like this:

lscm list remotefiles -r local --depth - --workspace "Workspace" "Component" > C:\jazz\Filelist.txt

Now I have to list files for all the components in the workspace. I cannot simply remove the "Component" as it is mandatory according to the syntax:

lscm list remotefiles [options] <selector> <component> [remotePath]

Is there any looping technique in RTC CLI that can be used to get filelist from all the components?

Shruthi
  • 61
  • 1
  • 1
  • 5

1 Answers1

1

Is there any looping technique in RTC CLI that can be used to get filelist from all the components?

Not exactly: you would need to list all components in your workspace, and then call your command to list files for each component.

See for instance "RTC Command Line and Listing Components", where you first create a session, and then list within that session:

creating a login session and using that, ie

lscm login -r https://csnext.myco.com/ccm6/ -u dlwester@myco.com -n mySession
lscm list components -r mySession 

Andrew Niefer suggests:

It would be better to specify the -u option to get UUIDs rather than using component names.

lscm -u y list components -r mySession

Also, depending on the scripting language, it may be better to specify -j to get json output.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Hi, I have all the components list. My question is how to call the command for each component? Do I have to give component name every time? I want to run the script during the login. So , providing the component dynamically (interactive way) is not an option for me. – Shruthi Jun 09 '16 at 11:46
  • @ShruthiS It depends on your scripting language. In bash for instance, see http://stackoverflow.com/q/8880603/6309. Try and separate the login step from the loop and its `list remotefiles` step. – VonC Jun 09 '16 at 20:15
  • It would be better to specify the -u option to get UUIDs rather than using component names. "lscm -u y list components -r mySession". Also, depending on the scripting language, it may be better to specify -j to get json output. – Andrew Niefer Jun 17 '16 at 14:54
  • @AndrewNiefer Good point. I have included your comment in the answer for more visibility. – VonC Jun 17 '16 at 15:33