annotate
apropos
catcr
catcs
cc.icon
cc.magic
cd
chactivity
chbl
checkin
checkout
checkvob
chevent
chflevel
chfolder
chmaster
chpool
chproject
chstream
chtype
chview
clearaudit
clearbug
cleardescribe
cleardiffbl
cleardiff
clearexport_ccase
clearexport_cvs
clearexport_pvcs
clearexport_rcs
clearexport_sccs
clearexport_ssafe
clearfsimport
cleargetlog
clearhistory
clearimport
clearjoinproj
clearlicense
clearmake
clearmake.options
clearmrgman
clearprojexp
clearprompt
cleartool
clearviewupdate
clearvobadmin
comments
config_ccase
config_spec
cptype
credmap
creds
deliver
describe
diffbl
diffcr
diff
dospace
edcs
endview
env_ccase
events_ccase
export_mvfs
exports_ccase
file
find
findmerge
fmt_ccase
getcache
get
getlog
help
hostinfo
init_ccase
ln
lock
lsactivity
lsbl
lscheckout
lsclients
lscomp
lsdo
lsfolder
lshistory
ls
lslock
lsmaster
lspool
lsprivate
lsproject
lsregion
lsreplica
lssite
lsstgloc
lsstream
lstype
lsview
lsvob
lsvtree
makefile_aix
makefile_ccase
makefile_gnu
makefile_pmake
makefile_smake
makefile_sun
man
merge
mkactivity
mkattr
mkattype
mkbl
mkbranch
mkbrtype
mkcomp
mkdir
mkelem
mkeltype
mkfolder
mkhlink
mkhltype
mklabel
mklbtype
mkpool
mkproject
mkregion
mkstgloc
mkstream
mktag
mktrigger
mktrtype
mkview
mkvob
mount_ccase
mount
msdostext_mode
mvfslog
mvfsstorage
mvfstime
mvfsversion
mv
omake
pathnames_ccase
permissions
profile_ccase
promote_server
protect
protectvob
pwd
pwv
query_language
quit
rebase
recoverview
reformatview
reformatvob
register
relocate
rename
reqmaster
reserve
rgy_backup
rgy_check
rgy_passwd
rgy_switchover
rmactivity
rmattr
rmbl
rmbranch
rmcomp
rmdo
rmelem
rmfolder
rmhlink
rmlabel
rmmerge
rmname
rmpool
rmproject
rmregion
rmstgloc
rmstream
rmtag
rmtrigger
rmtype
rmver
rmview
rmvob
schedule
schemes
scrubber
setactivity
setcache
setcs
setplevel
setsite
setview
shell
snapshot.conf
softbench_ccase
space
startview
type_manager
umount
uncheckout
unlock
unregister
unreserve
update
version_selector
view_scrubber
vob_restore
vob_scrubber
vob_sidwalk
vob_snapshot
vob_snapshot_setup
wildcards_ccase
winkin
xclearcase
xcleardiff
xmldiffmrg
SYNOPSIS
Conversion specifications: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.
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.)
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
The conversion specification format closely resembles that of the C-language function printf():
- Percent sign (%)
- Optionally, a minimum and/or maximum field display width specifier, of the form min.max (see “Specifying Field Width”.
- Optionally (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:
- %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:
- %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:
- %d
- Date/Time. The time stamp of the operation
or event, in date.time format.
Variants:
- %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:
- %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:
- %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.
- %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. - %m
- Object kind — The kind of object
involved in the operation. For example:
Variant:file element branch version stream derived object branch type label type - %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:
- %o
- Operation kind — The operation that
caused the event to take place; commonly, the name of a cleartool subcommand.
For example:
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 and ClearCase LT variants,
see Table 4. For UCM variants, see Table 5. For MultiSite variants, see Table 6.
Table 4. Variants for ClearCase and ClearCase LT Objects
The variants in Table 5 apply only to UCM objects.
Table 5. Variants for UCM Objects
The variants in Table 6 apply only to objects in replicated VOBs (ClearCase MultiSite product).
Table 6. Variants for Replicated Objects
- %[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:
- %u
- Login name of the user associated with the event. Variants:
- %%
- 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 "...".
EXAMPLES
The UNIX examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.
The Windows examples that include 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 UNIX shell or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt.
Note: In the UNIX examples that follow, arguments and output that show multicomponent VOB tags are not applicable to ClearCase LT, which recognizes only single-component VOB tags. In this manual, a multicomponent VOB tag is by convention a two-component VOB tag of the form /vobs/vob-tag-leaf—for example, /vobs/src. A single-component VOB tag consists of a leaf only—for example, /src. In all other respects, the examples are valid for ClearCase LT.
- Format the output from lsco –cview.
- 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.)
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@@/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 - Describe a checked-out element, util.c.
- Display the type of a file element.
- Display the target of a symbolic link and the target after the link is traversed.
- Display the master replica of all label types in a VOB replica.
- Display the name of an element, using tabular format. The command is a single input line; line breaks are added for readability.
- Mimic the output from lshistory –long. Note the use of single quotes to enclose the format string, which includes literal double quotes.
- Mimic the output from lshistory –long. Note that in cleartool single-command mode, backslashes (\) are used to escape double quotes in the format string.
- 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.
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