2

The fmt_ccase documentation for cleartool gives this as a formatting option:

%[p]p
Property value: Displays the value of the property specified in square brackets. If multiple values are returned, they are separated by spaces.

However, the page doesn't list the possible values for [p] as far as I can tell, and I can't find any other reference to this anywhere in the ClearCase documentation.

I would like to use this to format output from lstype for scripting purposes, to print out properties of a type such as the supertype and type manager. Can anyone point me in the right direction?


Here is sample output for what I'm ultimately trying to do:

foo
superfoo
foo_mgr

where foo is the type, superfoo is the supertype of foo, and foo_mgr is the type manager for foo.

Kevin K
  • 9,344
  • 3
  • 37
  • 62

1 Answers1

1

You will find all the properties in the fmt_ccase page.

Format strings for command output

-fmt option syntax (used in various reporting commands: annotate, describe, lshistory, lscheckout, and so on):

-fmt "format-string"

format-string is a character string, composed of alphanumeric characters, conversion specifications, and escape sequences. It must be enclosed in double quotes ( " ).

More precisely, the section:

%[p]p

Property value: Displays the value of the property specified in square brackets. If multiple values are returned, they are separated by spaces.

For instance:

Display the type of a file element.

cleartool describe -fmt "Type:  %[type]p\n"  util.c@@

Type: text_file

See an lstype example at "How to find all the branch type created by one person in ClearCase?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you @VonC, but that much is clear to me. What I don't know is the possible values for `[p]`. In your example, you use `[type]`, but how do I know that is a property I can use? To go back to my concrete example, I've tried `%[supertype]p`, but it doesn't print anything for that parameter. – Kevin K Dec 11 '12 at 16:33
  • 1
    Ahh, I see `[type]` now in _Table 1. Variants for ClearCase and ClearCase LT objects_. But I don't see any option for printing the supertype...is it not possible? – Kevin K Dec 11 '12 at 16:35
  • Can you give an example of the kind of output you need? – VonC Dec 11 '12 at 16:38
  • I added it to the question. – Kevin K Dec 11 '12 at 16:46
  • For what it's worth, I think I can probably parse the information from `lstype -l`, but it would be much more convenient if I could use `-fmt` to put it in the form above instead – Kevin K Dec 11 '12 at 17:14
  • The type itself is a ClearCase object that you can describe. I will check for the super type and type manager though. – VonC Dec 11 '12 at 17:20
  • @KevinK yes, I don't see anything regarding those information. Parsing the `lstype` output remains the simplest way to extract those data. My answer was about the more general aspect of your question: " the page doesn't list the possible values for `[p]`": yes, it does. – VonC Dec 11 '12 at 17:53