Search code examples
command-lineclearcasecleartool

How to indent multi-line clearcase comment using cleartool format (-fmt)


Is it possible to re-create standard "desc" command indenting of comments using cleartool format string?

Example:

cleartool desc <version> outputs something like

version "<extended version path>"
created <date> by <user>
  "comment line 1
   comment line 2
   ...
   comment line n"
...

Is there -fmt option to create similar output with custom format?


Solution

  • Not directly, regarding the indent part.
    fmt_ccase man page does propose the extended version path, date, user and comment, but you can only put spaces or tabs (ie 'escape sequences') in front of each fields, not put tabs in the middle of one of those fields (like tabs in front of each lines of a comment)

    cleartool descr -fmt "version \"%Xn\"\ncreated %d by %u\n\t\"%c\"" afile
    

    Note than one of the examples seems to indicates that spaces put in front of a field are repeated for all the lines of that field:

    Mimic the output from lshistory –long.
    Note that in cleartool single-command mode, backslashes (\) are used to escape double quotes in the format string.

    cleartool lshistory -fmt "%d      %Fu (%u@%h)\n  %e \"%n\"\n  \"%Nc\"\n"  util.c 
    2007-05-11T09:24:38     Anne Duvo (anne@neptune)
      create version "util.c@@\main\3"
      "fix bug r2-307"
    2007-05-10T09:09:29     Ravi Singha (ravi@mercury)
      create version "util.c@@\main\2"
      "ready for code review"
    .
    .
    .