fmt_ccase

Format strings for command output

APPLICABILITY

ClearCase (general information), Attache (general information)

SYNOPSIS

Conversion specifications:

%a

Attributes (modifiers: N, S, [attr-name])

%c

Comment string (modifiers: N)

%d

Date (modifiers: S, V, N, A, MA, BA, OA)

%e

Event description

%f

Checked-out version information (modifiers: R, T, [text])

%h

Host name

%i

Indent level (modifier: [indent-level])

%l

Labels (modifiers: C, N)

%m

Object kind (version, derived object, and so on) (modifiers: K)

%n

Name of object (modifiers: D, E, L, O, S, PS, PV, V, X)

%o

Operation kind (checkin, lock, mkelem, and so on)

%p

Property value (modifiers: [property], C, D, O, S, T)

%[c]t

Starting column number (modifiers: N, S, T)

%u

User/group information (modifiers: F, G, L)

%%

% character

Escape sequences:

\n

<NL>

\t

<TAB>

\'

Single quote

\\

Literal (uninterpreted) backslash

\nnn

Character specified by octal code

DESCRIPTION

Many ClearCase and Attache commands read information from a VOB database, format the data, and send it to standard output. (In most cases, the information is stored in event records, written by the command when it creates or modifies an object in a VOB. See the events_ccase reference page.) Some of these commands have a -fmt option, which you can use to format simple reports on VOB contents. Note that -fmt is a mutually exclusive alternative to the -short and -long options.

The following example shows how output-formatting options affect an lshistory command.

cmd-context lshistory -since 1-Feb util.c
10-Feb.11:21 anne create version "util.c@@\main\rel2_bugfix\1"
"fix bug: extra NL in time string"
10-Feb.11:21 anne create version "util.c@@\main\rel2_bugfix\0"
10-Feb.11:21 anne create branch "util.c@@\main\rel2_bugfix"

cmd-context lshistory -short -since 1-Feb util.c
util.c@@\main\rel2_bugfix\1
util.c@@\main\rel2_bugfix\0
util.c@@\main\rel2_bugfix

cmd-context lshistory -fmt "\tElement: %-13.13En Version: %Vn\n" -since 1-Feb util.c
Element: util.c Version: \main\rel2_bugfix\1
Element: util.c Version: \main\rel2_bugfix\0
Element: util.c Version: \main\rel2_bugfix

(A \t escape sequence tabs output to the next tab stop. Tab stops occur at eight-character intervals, except as described in the annotate reference page.)

CONVERSION SPECIFICATIONS

A conversion specification identifies a particular data item to display and specifies its display format.

Syntax
%[ min ][.max ][ MODIFIER [, ... ] ]keyletter

The conversion specification format closely resembles that of the C-language function printf():

Unlike printf() specifiers, conversion specifications are not replaced by arguments supplied elsewhere on the command line; they are replaced automatically by cleartool or Attache, usually with field values extracted from event records.

These are the conversion specifications:

%a

All attached attributes. Attributes are listed as attr-name=value pairs. These pairs are enclosed in parentheses and separated by a comma-space combination (,SPACE). Variants:

%Na

No commas. Suppress the parentheses and commas in attribute list output; separate multiple attributes with spaces only.

%Sa

Value only. Display attribute values only (rather than attr=value)

%[attype]a

This attribute only. Display only the specified attribute, if it has been attached to the object

%c

Comment string. The user-supplied or system-generated comment stored in an event record. A newline character is appended to the comment string for display purposes only. Variant:

%Nc

No newline. Do not append a newline character to the comment string.

%d

Date/Time. The time stamp of the operation or event, in date.time format. Variants:

%Sd

(Short) Date only.

%Vd

(Very long) Day of week, date, and time.

%Nd

(Numeric) Date and time in numeric form - yyyymmdd.time (time reported in 24-hour format).

%Ad

Age in days.

%MAd

Age in months.

%BAd

Age as a bar graph (longer bars for more recent events). A bar graph is drawn as a sequence of 0-5 number signs (#), representing the elapsed time since the reported operation as follows:

#####

Less than a week

####

Less than a month

###

Less than three months

##

Less than six months

#

Less than a year

More than a year

%OAd

Age as a bar graph (longer bars for older events). A bar graph is drawn as a sequence of 0-5 number signs (#), representing the elapsed time since the reported operation as follows:

#####

More than a year

####

Less than a year

###

Less than six months

##

Less than three months

#

Less than a month

Less than a week

%e

Event kind; a brief description of the event. The event kind is derived programmatically from an event record's name, object kind, and operation kind fields. Sample event kinds:
create version
create branch
make hyperlink "Merge" on version
make label "REL2" on version
lock branch type
%f

Checked-out version information - For an element checked out to your view, the version-ID of the checked-out element; for an element that is not checked out to your view, displays nothing. Variants:

%Rf

Checkout status - reserved or unreserved.

%Tf

View tag - the view-tag of the view that checked out the element.

%[text]f

Text - Displays text as a prefix to the version-ID.

%h

Name of the host where the event originated (the host on which the user %u was running when she or he caused the event). The host name is stored in the ComputerName key in the Windows Registry.
%l

Labels - For versions, all attached labels; the null string otherwise. Labels are output as a comma-separated list, enclosed in parentheses. A <SPACE> character follows each comma. Variants:

%Cl

Max labels - Specify the maximum number of labels to display with the max-field-width parameter (see Specifying Field Width). If there are more labels, "..." is appended to the output. If no max-field-width is specified, the maximum defaults to three.

%Nl

No commas - Suppress the parentheses and commas in label list output; separate labels with spaces only.

%m

Object kind - The kind of object involved in the operation. For example:
file element
branch
version
stream
derived object
branch type
label type
Variant:

%Km

Object selector kind - For example, brtype or lbtype. For more information about object selectors, see the cleartool reference page.

%n

Name of object - For a file-system object, the extended pathname (including the version-ID for versions, and the DO-ID for derived objects); for a type object, its name. Variants:

%Dn

Database identifier (DBID) - The unique database identifier of the object.

%En

Element name - For a file-system object, its standard file or element name, or its pathname; for a type object, its name.

%Ln

Leaf name - For any named object, its simple name. The terminal node of a pathname. This modifier can be combined with others.

%On

Object identifier (OID) - The unique identifier of a VOB object.

%Sn

Short name - For a version, a short form of the version-ID: branch-pathname/version-number. For other objects, the null string.

%PSn

Predecessor Short name - For a version, a short form of the predecessor version's version-ID: branch-pathname/version-number. For other objects, the null string.

%Vn

Version ID - For a version or derived object, the version-ID; for other objects, the null string.

%PVn

Predecessor Version ID - For a version, the predecessor version's version-ID; for other objects, the null string.

%Xn

Extended name - Same as default %n output, but for checked-out versions, append the.extension @@\branch-pathname\CHECKEDOUT. For non-file-system objects, prints the object selector. For more information about object selectors, see the cleartool reference page.

%o

Operation kind - The operation that caused the event to take place; commonly, the name of a cleartool subcommand or an Attache command. For example:
mkelem
mklabel
checkin
checkout
See the events_ccase reference page for a complete list of operations and the commands that cause them.
%[p]p

Property value - Displays the value of the property specified in square brackets. The following tables list variants and the objects to which they apply. For ClearCase variants, see Table 3 . For UCM variants, see Table 4 . For MultiSite variants, see Table 5 .

Table 3 Variants for ClearCase Objects


Variant

Applies to

Description

%[name]p


All objects


Same as %n, including variants.


%[object_kind]p


All objects


Kind of object. For example: version, file element, directory element, versioned object base, replica, branch type, and so on.


%[locked]p


All objects that can be locked


Lock status of the object: locked, unlocked, or obsolete.


%[version_predecessor]p


Versions


Version-ID (branch pathname and version number) of the version's predecessor version.


%[type]p


Versions, elements


Name of version or element's element type (see type_manager for a list of element types); not to be confused with the object kind (for which the conversion specification is %m).


%[triggers]p


Elements


List of trigger types attached to element. Does not list all-element triggers. The list is displayed in the following format:

(trtype, trtype, trtype, ...)


%[triggers]Np


Elements


Suppresses parentheses and commas.


%[pool]p


Elements, shared derived objects


For an element, name of source pool. For a shared DO, name of DO pool.


%[pool]Cp


Elements


Name of cleartext pool.


%[pool]Dp


Shared derived objects


Name of derived object pool.


%[pool]Sp


Elements


Name of source pool.


%[DO_kind]p


Derived objects


Kind of derived object: shared, unshared, non-shareable.


%[DO_ref_count]p


Derived objects


Reference count for derived object.


%[slink_text]p


VOB symbolic links


Target of symbolic link, as displayed by cleartool ls.


%[slink_text]Tp


VOB symbolic links


Target of symbolic link, after link is traversed.


%[type_scope]p


Metadata object types


Object type's scope.

  • ordinary means that use of the type is limited to the current (or specified) VOB
  • global means that the VOB is an administrative VOB and the type can be used in any client VOB of the admin VOB or in any client VOB of a lower-level Admin VOB within an Admin VOB hierarchy
  • local copy means that the type has been copied to the VOB from the Admin VOB that contains the master version of the type's definition

%[type_constraint]p


Branch types, label types


Constraint on type object: one version per element or one version per branch.


%[trigger_kind]p


Trigger types


Kind of trigger type: element trigger, all element trigger, type trigger.


%[msdostext_mode]p


VOBs


State of MS-DOS text mode setting for VOB: enabled or disabled.


%[group]p



Group name.


%[owner]p



Login name of the object's owner.




Login name of the objects` owner. The optional F argument lists the owner's full name.

The variants in Table 4 apply only to UCM objects.

Table 4 Variants for UCM Objects


Variant

Applies to

Description

%[stream]p


UCM activities


The stream containing the activity.


%[crm_record_id]p


UCM activities


A ClearQuest record ID.


%[component]p


UCM baselines


The component associated with the baseline.


%[label_status]p


UCM baselines


The label status of a baseline: full, incremental, or unlabeled.


%[root_dir]p


UCM components


The root directory for the component.


%[contains_folders]p


UCM folders


Subfolders of the folder.


%[folder]p


UCM folders


The parent folder for the folder.


%[contains_projects]p


UCM folders


Projects contained by the folder.


%[istream]p


UCM projects


The project integration stream.


%[dstreams]p


UCM projects


The project development streams.


%[folder]p


UCM projects


The parent folder for the project.


%[mod_comps]p


UCM projects


The modifiable components for a project.


%[def_rebase_level]p


UCM projects


The promotion level required of a baseline before it can be used as the source of a rebase operation.


%[rec_bls]p


UCM projects


The project's recommended baselines.


%[activities]p


UCM streams


Activities that are part of the stream.


%[project]p


UCM streams


The project the stream is part of.


%[found_bls]p


UCM streams


The foundation baselines for the stream.


%[views]p


UCM streams


Views attached to the stream.

The variants in Table 5 apply only to objects in replicated VOBs (ClearCase MultiSite product).

Table 5 Variants for Replicated Objects


Variant

Applies to

Description

%[master]p


All objects that have mastership


Name of object's mastering replica.


%[master]Op


All objects that have mastership


OID of object's mastering replica.


%[reqmaster]p


Replicas, branch types, branches


Request for mastership status of the object.

For a replica:

  • disabled means that requests for mastership are not enabled in the replica
  • enabled means that requests for mastership are enabled in the replica

For a branch type:

  • all instances denied means that requests for mastership of any instance of the branch type are denied
  • all instances allowed means that requests for mastership of any instance of the branch type will be allowed (unless mastership requests for the specific branch are denied)

For a branch:

  • denied means that requests for mastership of the branch are denied
  • allowed means that requests for mastership of the branch are allowed

%[type_mastership]p


Attribute types, hyperlink types, label types


Kind of mastership of the type: shared or unshared.


%[vob_replication]p


VOBs


Replication status of VOB: replicated or unreplicated.


%[replica_name]p


VOBs


Replica name of the specified VOB.


%[replica_host]p


Replicas


Name of replica host.

%[c]t

Starting column number - Starts printing at the column number specified in square brackets. An overflow condition exists if the current position on the line is beyond the starting column number. By default, when an overflow condition occurs, the %t directive is ignored. Variants:

%[c]Nt

When an overflow condition occurs, print a newline and resume printing at the starting column number.

%[c]St

When an overflow condition occurs, print one space before printing the next value.

%[c]Tt

When an overflow condition occurs, print a tab before printing the next value.

%u

Login name of the user associated with the event. Variants:

%Fu

Full name of the user. This information is taken from the password database.

%Gu

Group name of the user.

%Lu

Login name and group of the user, in the form user.group.

%%

Percent character (%).
Specifying Field Width

A conversion specification can include an optional field width specifier, which assigns a minimum and/or maximum width, in characters, to the data field display. For example, the conversion specifier %10.15Lu will display, for each output line, the user's login name and group with a minimum of 10 characters (space padded if necessary) but not more than 15.

Usage rules:

EXAMPLES

Examples including wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.

In cleartool single-command mode, cmd-context represents the command interpreter prompt. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt. In Attache, cmd-context represents the workspace prompt.

cmd-context lsco -cview -fmt "\t%-10.10n (from %8.8PVn) %d %u\n"
util.c    (from \main\23) 24-Jun-99.14:12:48 anne
main.c    (from \main\46) 23-Jun-99.18:42:33 anne
msg.c     (from bugfix\11) 23-Jun-99.10:45:13 anne
msg.h     (from bugfix\3) 22-Jun-99.14:51:55 anne
cmd-context lshistory -fmt "OBJ-NAME: %-20.20n\n USER: %-8.8u\n DATE: %d\\n
OPERATION:\t%-12.12o\n OBJ-TYPE:\t%-15.15m\n EVENT:\t%e\n
COMMENT: %c\n" util.c
OBJ-NAME: util.c@@main3
USER: anne
DATE: 10-May-99.09:24:38
OPERATION: checkin
OBJ-TYPE: version
EVENT: create version
COMMENT: fix bug r2-307
OBJ-NAME: util.c@@main2
USER: anne
DATE: 10-May-99.09:09:29
OPERATION: checkin
OBJ-TYPE: version
EVENT: create version
COMMENT: ready for code review
cmd-context describe -fmt "\tVer:\t%f\n\tPrefix:\t%[MY TEXT]%f\n\t Status:\t%Rf\n\tView:\t%Tf\n" util.c
        Ver:    \main\23
        Prefix: MY TEXT\main\23
        Status: reserved
        View:   eba_view
cmd-context describe -fmt "Type:  %[type]p\n"  util.c@@
Type: text_file
cmd-context describe -fmt "%n\t%[slink_text]p\t%[slink_text]Tp\n" link1.txt
link1.txt     file.txt     ..\dev\file.txt
cmd-context lstype -fmt "Label type: %n\tMaster: %[master]p\n" -kind lbtype
Label type: BACKSTOP    Master: evanston@\tromba
Label type: CHECKEDOUT  Master: evanston@\tromba
Label type: LATEST      Master: evanston@\tromba
Label type: V3.4        Master: paris@\tromba
cmd-context describe -fmt
"%[4]tName:%[6]t%[name]p\n
%[4]tName:%[6]Nt%[name]p\n
%[4]tName:%[6]St%[name]p\n
%[4]tName:%[6]Tt%[name]p\n" util.c
   Name:util.c@@\main\30
   Name:
     util.c@@\main\30
   Name: util.c@@\main\30
   Name:        util.c@@\main\30
cleartool lshistory -fmt "%d      %Fu (%u@%h)\n  %e \"%n\"\n  \"%Nc\"\n"  util.c
11-May-99.09:24:38     Anne Duvo (anne@neptune)
  create version "util.c@@\main\3"
  "fix bug r2-307"
10-May-99.09:09:29     Ravi Singha (ravi@mercury)
  create version "util.c@@\main\2"
  "ready for code review"
.
.
.
cmd-context describe -fmt "Name (default): %n\n
Element name: %En\n
Leaf name: %Ln\n
Short name: %Sn\n
Predecessor short name: %PSn\n
Version ID: %Vn\n
Predecessor version ID: %PVn\n
Extended name: %Xn\n
Attributes: %a\n
Attr values only: %Sa\n
Attrs without commas or parens: %Na\n
This attr only: %[Tested]a\n
Comment: %c
Date/Time: \tdefault: %d\n
\t\tshort: %Sd\n
\t\tlong: %Vd\n
Age in days: %Ad\n
Age in months: %MAd\n
Age graph (long = new): %BAd\n
Age graph (long = old): %OAd\n
Host: %h\n
Labels: %Cl\n
Labels without commas or parens: %Nl\n
Object kind: %m\n
Operation kind: %o\n
Event kind: %e\n
User (default): %u\n
Full user name: %Fu\n
Group name: %Gu\n
Long name: %Lu\n\n" main.c
Name (default): main.c@@\main\34
Element name: main.c
Leaf name: 34
Short name: \main\34
Predecessor short name: \main\33
Version ID: \main\34
Predecessor version ID: \main\33
Extended name: main.c@@\main\34
Attributes: (Tested="yes", QAlevel=4, Responsible="anne")
Attr values only: ("yes", 4, "anne")
Attrs without commas or parens: Tested="yes" QAlevel=4 Responsible="anne"
This attr only: (Tested="yes")
Comment: still needs QA
Date/Time:    default: 30-Jul-99.15:02:49
              short: 30-Jul-99
              long: Tuesday 07/30/99 15:02:49
Age in days: 42
Age in months: 1
Age graph (long = new): ####
Age graph (long = old): ##
Host: neptune
Labels: (Rel3.1C, Rel3.1D, Rel3.1E)
Labels without commas or parens: Rel3.1C Rel3.1D Rel3.1E
Object kind: version
Operation kind: checkin
Event kind: create version
User (default): anne
Full user name: Anne Duvo
Group name: dev
Long name: anne.dev

SEE ALSO

annotate, cleartool, describe, events_ccase, lsactivity, lsbl, lscheckout, lscomp, lsdo, lsfolder, lshistory, lslock, lspool, lsproject, lsreplica, lsstream, lstype, reqmaster, type_manager



Feedback on the documentation in this site? We welcome any comments!
Copyright © 1999 by Rational Software Corporation. All rights reserved.