Search code examples
labelclearcaselscleartool

Cleartool - List Objects with Their Labels


I want to list all objects (including files and directories) recursively with labels their have.
When I run the following command, it writes only Rule. It does not write all labels on any object.

cleartool ls -r -l /view/stable/MYVOB/MyProject

Result :

version /view/stable/MYVOB/Car.java@@/main/3 Rule: element * TO_TEST
version /view/stable/MYVOB/Driver.java@@/main/2 Rule: element * TO_TEST

How can I list the all labels?
In addition, listing modifiers and modification date will be plus for me.

Thanks in advance...


Solution

  • You can use a cleartool find, using fmt_ccase options to display the associated labels

    Windows Syntax:

    cleartool find . -type f -ele "brtype(mybranch)" -exec "cleartool descr -fmt \"%n labels:%l\n\" \"%CLEARCASE_PN%\""
    

    Unix Syntax:

    cleartool find . -type f -ele "brtype(mybranch)" -exec 'cleartool descr -fmt "%n labels:%l\n" "$CLEARCASE_PN"'
    

    The idea is to described each element found ($CLEARCASE_PN) by using the %l option of the fmt_ccase directives in order to print labels associated with it.