Home
Command  Home
Scalable Graphic

logo_header

Soft - is your software and documentation
Asset - is something that must be protected
Management - is what we do
Enterprise - is the capability
Computing - is the power
Services - are what we provide


Synopsis

–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 ( " ).

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 associated with the object's creation event (modifiers: F, G, L); see also %[owner]p and %[group]p.

%%

% character

Escape sequences:

\n

<NL>

\t

<TAB>

\'

Single quote

\\

Literal (uninterpreted) backslash

\nnn

Character specified by octal code

A.    Description

Many ClearCase and ClearCase LT 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.

cleartool 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"

cleartool lshistory -short -since 1-Feb util.c

util.c@@/main/rel2_bugfix/1
util.c@@/main/rel2_bugfix/0
util.c@@/main/rel2_bugfix

cleartool 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.)

Note: In commands that output data on multiple versions, such as lshistory and lsvtree, formatting is applied to each version, not to the command output as a whole.

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():

· Percent sign (%)

· (Optional) A minimum and/or maximum field display width specifier, of the form min.max (see the section Specifying field width.)

· (Optional for some conversion specs) One or more modifier characters (uppercase) that specify one or more variants and/or a bracket-enclosed parameter (see the %a conversion specification)

· A key letter (lowercase), which indicates the kind of data to display

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

These are the conversion specifications:

B.    %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

 

bash-3.00$ ct desc -fmt "%a\n" install

(CIstate="Under_work")

bash-3.00$ ct desc -fmt "%Na\n" install

CIstate="Under_work"

bash-3.00$ ct desc -fmt "%Sa\n" install

("Under_work")

bash-3.00$ ct desc -fmt "%SNa\n" install

"Under_work"

bash-3.00$ ct desc -fmt "%[CIstate]SNa\n" install

"Under_work"

C.    %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.

 

bash-3.00$ ct desc -fmt "%c" install

Updating by samecs

bash-3.00$ ct desc -fmt "%Nc" install

Updating by samecsbash-3.00$

D.    %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

 

bash-3.00$ ct desc -fmt "%d\n" install

06-Feb-08.09:53:14

bash-3.00$ ct desc -fmt "%Sd\n" install

06-Feb-08

bash-3.00$ ct desc -fmt "%Vd\n" install

Wed 06 Feb 2008 09:53:14 GMT

bash-3.00$ ct desc -fmt "%Nd\n" install

20080206.095314

bash-3.00$ ct desc -fmt "%Ad\n" install

0

bash-3.00$ ct desc -fmt "%MAd\n" install

0

bash-3.00$ ct desc -fmt "%BAd\n" install

#####

bash-3.00$ ct desc -fmt "%OAd\n" install

    

bash-3.00$

E.    %e

Event kind; a brief description of the event. The event kind is derived 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

bash-3.00$ ct desc -fmt "%e\n" install

checkout version

F.     %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.

 

bash-3.00$ ct desc -fmt "%f\n" install

/main/1

bash-3.00$ ct desc -fmt "%Rf\n" install

reserved

bash-3.00$ ct desc -fmt "%Tf\n" install

samecs_view

bash-3.00$ ct desc -fmt "%[testing]f\n" install

testing/main/1

bash-3.00$

G.    %h

Name of the host where the event originated (the host on which the user %u was running that user caused the event). The host name is as reported by uname(2) (UNIX) or as stored in the ComputerName key in the Windows Registry (Windows).

For a VOB replica, %h displays the name of the host at which the mkreplica –export command that created the replica was entered. For the original replica in a family, this is the host where the original VOB was located when the first mkreplica –export command was entered.

bash-3.00$ ct desc -fmt "%h\n" install

SAMECS-VAIO-01

bash-3.00$ 

H.    %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 default value is 3.

%Nl

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

 

bash-3.00$ ct desc -fmt "%l\n" install@@/main/1

(CONSTRUCTION_ITERATION1)

bash-3.00$ ct desc -fmt "%Nl\n" install@@/main/1

CONSTRUCTION_ITERATION1

bash-3.00$ ct desc -fmt "%CNl\n" install@@/main/1

CONSTRUCTION_ITERATION1

bash-3.00$

I.       %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.

 

bash-3.00$ ct desc -fmt "%m\n" install        

version

bash-3.00$ ct desc -fmt "%m\n" install@@

file element

bash-3.00$ ct desc -fmt "%m\n" install@@/main

branch

bash-3.00$ ct desc -fmt "%Km\n" install@@/main

J.     %n

Name of object: For a file system object, the extended path name (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 path name; for a type object, its name.

%Ln

Leaf name: For any named object, its simple name. The terminal node of a path name. 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.

 

bash-3.00$ ct desc -fmt "%n\n" install 

install

bash-3.00$ ct desc -fmt "%Dn\n" install

41279

bash-3.00$ ct desc -fmt "%En\n" install

install

bash-3.00$ ct desc -fmt "%Ln\n" install

install

bash-3.00$ ct desc -fmt "%On\n" install

b9577918.5a33499e.b2b5.52:1a:57:5c:d9:c1

bash-3.00$ ct desc -fmt "%Sn\n" install

/main/CHECKEDOUT

bash-3.00$ ct desc -fmt "%PSn\n" install

/main/1

bash-3.00$ ct desc -fmt "%PVn\n" install

/main/1

bash-3.00$ ct desc -fmt "%Vn\n" install

/main/CHECKEDOUT

bash-3.00$ ct desc -fmt "%Xn\n" install

install@@/main/CHECKEDOUT

bash-3.00$

K.    %o

Operation kind: The operation that caused the event to take place; commonly, the name of a cleartool subcommand. For example:

mkelem
mklabel
checkin
checkout

See the events_ccase reference page for a complete list of operations and the commands that cause them.

bash-3.00$ ct desc -fmt "%o\n" install

checkout

bash-3.00$ ct desc -fmt "%o\n" install@@

mkelem

bash-3.00$ ct desc -fmt "%o\n" install@@/main

mkelem

bash-3.00$ ct desc -fmt "%o\n" install@@/main/1

checkin

bash-3.00$

L.     %[p]p

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

%[p]Xp

Extended property value: Displays the long form of the value of the property specified in square brackets. Not all property values have both long and short forms. Versions, in particular, are always displayed as though X had been specified.

%[p]Cp

Separate list items with a comma as well as a space.

%[p]Qp

Enclose pathnames in quotation marks (applies only to %[versions]).

The following tables list variants and the objects to which they apply. For ClearCase and ClearCase LT variants, see Table 1. For UCM variants, see Table 2. For MultiSite variants, see Table 3.

 

bash-3.00$ ct desc -fmt "%[name]p\n" install

install

bash-3.00$ ct desc -fmt "%[object_kind]p\n" install

version

bash-3.00$ ct desc -fmt "%[locked]p\n" install

unlocked

bash-3.00$ ct desc -fmt "%[version_predecessor]p\n" install

/main/1

bash-3.00$ ct desc -fmt "%[type]p\n" install

text_file

bash-3.00$ ct desc -fmt "%[group]p\n" install

users

bash-3.00$ ct desc -fmt "%[owner]p\n" install

samecs

bash-3.00$ ct desc -fmt "%[owner]Fp\n" install

SAMECS Ltd

 

Table 1. Variants for ClearCase and ClearCase LT 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.

%[activity]p

Versions

Activity whose change set contains the specified version.

%[version_predecessor]p

Versions

Version ID (branch path name and version number) of the version's predecessor version.

%[type]p

Versions, elements

Name of version or element's element type (for a list of element types, see type_manager); 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 administrative VOB or in any client VOB of a lower-level administrative VOB within an administrative VOB hierarchy.

local copy means that the type has been copied to the VOB from the administrative 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 (Windows only)

 

Login name of the object's current owner.

%[owner]Fp

 

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

%[hlink:filter]p

hyperlinks

Displays the hyperlink source and target, with an arrow pointing from the source to the target. The optional H argument lists only the hyperlink names. You can optionally specify a filter string, preceded by a colon. This filter if present, restricts the output to names that match the filter string. Case is considered when matching the string.

%[aliases]ACQp

File system objects

Displays the object's name and aliases. Pathnames can be quoted, separated by commas, or both. Specify A to include aliases displayed by describe -all

%[permissions]p

File system objects

Displays the object's permissions using the standard "rwx" notation.

%[flevel]p

VOBs

Displays the feature level of the VOB.

The variants in Table 2 apply only to UCM objects.

Table 2. Variants for UCM objects

Variant

Applies to

Description

%[contrib_acts]CXp

UCM activities

List of activities that contributed to the change set of an integration activity

%[crm_record_id]p

UCM activities

The ClearQuest® record ID

%[crm_record_type]p

UCM activities

The ClearQuest record type

%[crm_state]p

UCM activities

The activity's state

%[headline]p

UCM activities

The activity's headline

%[name_resolver_view]p

UCM activities

A “best guess” view for resolving the names of versions in a change set

%[stream]Xp

UCM activities

The stream that contains the activity

%[versions]CQp

UCM activities

List of versions in activity's change set

%[view]p

UCM activities

The view that the activity is set in

%[activities]CXp

UCM baselines

The baseline's activities

%[bl_stream]Xp

UCM baselines

The stream in which the baseline is created

%[component]Xp

UCM baselines

The component associated with the baseline

%[components]CXp

UCM streams

The components for which the stream has foundation baselines.

%[mod_comps]CXp

UCM streams

The modifiable components for which the stream has foundation baselines.

%[non_mod_comps]CXp

UCM streams

The non-modifiable components for which the stream has foundation baselines.

%[depends_on]Cp

UCM baselines

The baselines that the composite baseline directly depends on

%[depends_on_closure]Cp

UCM baselines

All of the baselines in the full dependence graph of a composite baseline

%[member_of]Cp

UCM baselines

The composite baselines of which the baseline is a direct member

%[member_of_closure]Cp

UCM baselines

All composite baselines of which the baseline is a direct or indirect member

%[label_status]p

UCM baselines

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

%[plevel]p

UCM baselines

The baseline's promotion level

%[predecessor]p

UCM baselines

The baseline's predecessor

%[initial_bl]Xp

UCM components

Initial baseline of the component

%[root_dir]p

UCM components

The root directory for the component

%[contains_folders]CXp

UCM folders

Subfolders of the folder

%[contains_projects]CXp

UCM folders

Projects contained by the folder

%[folder]Xp

UCM folders

The parent folder for the folder

%[crm_database]p

UCM projects

The name of the ClearQuest database

%[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

%[dstreams]CXp

UCM projects

The project development streams

%[folder]Xp

UCM projects

The parent folder for the project

%[istream]Xp

UCM projects

The project integration stream

%[mod_comps]CXp

UCM projects

The modifiable components for a project

%[model]p

UCM projects

The project's model

%[rec_bls]CXp

UCM projects

The recommended baselines of a project's integration stream

%[plevels]p

UCM PVOBs

The promotion levels defined by the PVOB

%[activities]CXp

UCM streams

Activities that are part of the stream

%[config_spec]p

UCM streams

Config spec of object

%[def_deliver_tgt]Xp

UCM streams

The default stream that the stream will deliver to

%[dstreams]CXp

UCM streams

The child streams of an integration stream or a development stream

%[found_bls]CXp

UCM streams

The foundation baselines for the stream

%[latest_bls]CXp

UCM streams

Latest baseline in each component in a stream's configuration

%[project]Xp

UCM streams

The project the stream is part of

%[read_only]p

UCM streams

read only if the stream is read-only, empty otherwise

%[rec_bls]CXp

UCM streams

The recommended baselines of an integration stream or a parent development stream

%[views]p

UCM streams

Views attached to the stream

%[policies]Cp

UCM streams and projects

Policies for a stream or project, in the form keyword setting, where keyword is a UCM policy keyword and setting is one of enabled or disabled.

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

Table 3. Variants for replicated objects

Variant

Applies to

Description

%[master]p

All objects that have mastership

Name of object's master replica

%[master]Op

All objects that have mastership

OID of object's master 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:

  • denied for all instances means that requests for mastership of any instance of the branch type are denied.
  • allowed for all instances means that requests for mastership of any instance of the branch type are allowed (unless mastership requests for the specific branch are denied).
  • denied for branch type means that requests for mastership of the branch type are denied.
  • allowed for branch type means that requests for mastership of the branch type 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.

%[replica_name]p

VOBs

Replica name of the specified VOB.

%[vob_replication]p

VOBs

Replication status of VOB: replicated or unreplicated.

%[replica_host]p

Replicas

Name of replica host.

M.    %[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.

N.    %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.

O.    %%

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:

·         A single number is interpreted as a minimum width.

·         To supply only a maximum width, put a decimal point before the number (for example, %.10En) or a zero and decimal point (%0.10En).

·         To specify a constant display width, set the minimum and maximum widths to the same value (%20.20c).

·         Values smaller than the specified minimum width are aligned on the right (padded left). A negative minimum width value (%–20.20c) aligns short values on the left.

·         Values longer than the specified maximum width are truncated from the right. A negative maximum width value (%15.–15Sn) truncates long values from the left.

·         A maximum width specifier has special meaning when used with the %Cl specifier. For example, %.5Cl prints a version's first five labels only, followed by "...".

Table of Contents

Synopsis. 3

A.       Description.. 4

B.       %a.. 5

C.       %c. 6

D.       %d.. 6

E.       %e. 8

F.       %f. 8

G.       %h.. 9

H.      %l. 9

I.        %m.. 10

J.        %n.. 11

K.      %o.. 12

L.       %[p]p. 13

M.      %[c]t. 21

N.       %u.. 21

O.       %%... 21

Specifying field width. 22

Table of Contents. 22

Examples: 23

How do I use cleartool <command> -fmt options to.. 23

1.       format the output from lsco –cview. 23

2.       format the event history of a file element. (The command line, including the quoted format string, constitutes a single input line. The input line below is broken to improve readability. Spaces are significant.) 24

3.       describe a checked-out element, util.c. 24

4.       display the type of a file element. 25

5.       display the target of a symbolic link and the target after the link is traversed. 25

6.       display the master replica of all label types in a VOB replica. 25

7.       display the name of an element, using tabular format. The command is a single input line; line breaks are added for readability. 26

8.       mimic the output from lshistory –long. Note the use of single quotes to enclose the format string, which includes literal double quotes. 26

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

10.     describe the element main.c in detail. This example illustrates many of the conversion specifications (but does not use field width specifiers). Again, the command is a single input line; line breaks are added for readability. 27

 

    Examples:

    How do I use cleartool <command> -fmt options to

1.       format the output from lsco cview.

cleartool lsco -cview -fmt "\t%-10.10n (from %8.8PVn) %d %u\n"

util.c (from /main/23) 18-Feb-03.14:12:48 anne
main.c (from /main/46) 18-Feb-03.18:42:33 anne
msg.c (from /bugfix/11) 19-Feb-03.10:45:13 anne
msg.h (from /bugfix/3) 19-Feb-03.14:51:55 anne

2.        format the event history of a file element. (The command line, including the quoted format string, constitutes a single input line. The input line below is broken to improve readability. Spaces are significant.)

 

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@@/main/3

   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@@/main/2

   USER: anne

   DATE: 10-May-99.09:09:29

   OPERATION: checkin

   OBJ-TYPE: version

   EVENT: create version

   COMMENT: ready for code review

3.   describe a checked-out element, util.c.

cleartool 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
      

4.   display the type of a file element.

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

Type: text_file

5.   display the target of a symbolic link and the target after the link is traversed.

cleartool describe –fmt "%n\t%[slink_text]p\t%[slink_text]Tp\n"

link1.txt
link1.txt     file.txt     ..\dev\file.txt

6.   display the master replica of all label types in a VOB replica.

cleartool lstype –fmt "Label type: %n\tMaster: %[master]p\n" –kind lbtype

Label type: BACKSTOP    Master: evanston@/vobs/tromba
Label type: CHECKEDOUT  Master: evanston@/vobs/tromba
Label type: LATEST      Master: evanston@/vobs/tromba
Label type: V3.4        Master: paris@/vobs/tromba

7.   display the name of an element, using tabular format. The command is a single input line; line breaks are added for readability.

cleartool 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

8.   mimic the output from lshistory –long. Note the use of single quotes to enclose the format string, which includes literal double quotes.

 

      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"

      .

      .

      .

 

9.   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

 

   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"

      .

      .

      .

10.       describe the element main.c in detail. This example illustrates many of the conversion specifications (but does not use field width specifiers). Again, the command is a single input line; line breaks are added for readability.

cleartool 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