ClearCase user-level commands (command-line interface)
cleartool> subcommand [ options/args ]
cleartool is the primary command-line interface to ClearCase version-control and configuration management software. It has a rich set of subcommands that create, modify, and manage the information in ClearCase VOBs and views.
Each individual cleartool subcommand is described in its own reference page.
cleartool provides several online help facilities for its subcommands:
(syntax of all subcommands)
cleartool help mklabel
(syntax of one subcommand)
cleartool mklabel -help
(syntax of one subcommand)
Reference pages are also accessible from the online help system's main contents (click Start `Programs`ClearCase`ClearCase Help, or click Help`Contents in any browser).
See the man reference page for more information.
You can use cleartool in either single-command mode or interactive mode. A single cleartool command can be invoked from the command interpreter using this syntax:
cleartool subcommand [ options-and-args ]
If you want to enter a series of subcommands, enter the cleartool command with no arguments. This places you at the interactive mode prompt:
You can then issue any number of subcommands (simply called "commands" from now on), ending with quit to return to the command interpreter. You can continue cleartool commands onto additional lines with the caret (^).
You can also use the -e option with cleartool. This places you in interactive mode, but if an error message occurs on one of the commands, you exit interactive mode. This is useful when running scripts.
Use cleartool -version to display this information"
The cleartool -VerAll command displays this information plus version information for the ClearCase DLLs that cleartool uses.
Command options may appear in any order, but all options must precede any nonoption arguments (typically, names of files, versions, branches, and so on). If an option is followed by an additional argument, such as -branch \main\bugfix, there must be white space between the option string and the argument. If the argument itself includes space characters, it must be enclosed in quotes.
Many subcommand names and option words can be abbreviated. A subcommand's syntax summary indicates all valid abbreviations. For example:
This means that you can abbreviate the option to the minimal -pre, or to any intermediate spelling: -pred, -prede, and so on.
For option words, the minimal abbreviation is always three characters or fewer.
A few cleartool commands have a built-in command alias. For example, checkin's alias is ci; checkout's alias is co. These commands are equivalent:
cleartool checkin test.c
cleartool ci test.c
Arguments in cleartool commands specify objects-either file-system objects (which may or may not be in a VOB) or non-file-system VOB objects. File-system objects are elements, versions, VOB symbolic links, derived objects, view-private directories, and view-private files. File-system objects also include files, and directories that have been loaded into a snapshot view. Examples of arguments that specify file-system objects:
cleartool ls .
cleartool mkelem new_doc
cleartool checkin -nc ..\src\main.h
Non-file-system VOB objects include types (attribute, branch, element, hyperlink, label, replica, trigger), pools, hyperlinks, replicas, and VOBs. Examples of arguments that specify non-file-system VOB objects:
cleartool lock brtype:v2_release
cleartool describe vob:\smg_tmp
cleartool mkhltype tested_by
The sections File-System Objects and Non-File-System VOB Objects give more details about specifying objects.
NOTE: If a nonoption argument begins with a hyphen (-), you may need to precede it with a double-hyphen argument to prevent it from being interpreted as an option.
Slashes (/) and backslashes (\) can be used interchangeably in pathnames in cleartool commands. For example, the following command is legal on a Windows host:
z:\myvob> cleartool ls /srcvob/util.c
To specify a file-system object as an argument, you can use either a full or relative pathname. In many cases, you can also use a ClearCase-defined variant: a view-extended pathname (full or relative) or a version-extended pathname (full or relative).
A full pathname begins with an optional drive letter and a backslash (\). For example:
(full pathname (non-VOB object))
(full pathname to VOB object - e: is assigned to a view)
(full pathname to VOB object; also called an absolute VOB pathname, because it begins with a VOB-tag (\myvob); only legal if current drive is assigned to a view; also used in config specs)
(view-extended full pathname (VOB object); the M: drive constitutes `view-extended namespace')
(full pathname (view-private file))
(version-extended full pathname)
NOTE: In general, you perform ClearCase operations in a view context, on a drive assigned with the Windows net use command or by clicking Tools`Map Network Drive in Windows Explorer. It is rare to work directly on M:, the default dynamic-views drive. However, it is common to use view-extended pathnames that include the M:\view-tag prefix.
A relative pathname does not begin with a backslash. For example:
(version-extended relative pathname)
NOTE: Pathnames relative to another drive (for example, c:\lib\util.o when c:\ is not the current drive) are not supported.
For both full and relative pathnames:
For more information, see the version_selector and pathnames_ccase reference pages.
NOTE: Although the ClearCase MVFS uses case-insensitive lookup by default, cleartool itself is case-sensitive.
In cleartool commands, you specify non-file-system VOB objects (VOBs, types, pools, hyperlinks, and replicas) with object selectors.
Object selectors identify non-file-system VOB objects with a single string:
Pathname of the VOB-tag (whether or not the VOB is mounted) or of any file-system object within the VOB (if the VOB is mounted)
In object-creation commands, you must compose the object name according to these rules:
In general, cleartool commands do not traverse VOB symbolic links; rather, they operate on the link objects themselves. For example:
In single-command mode, the cleartool command you enter is processed first by the Windows command interpreter and C run-time library, then by cleartool:
Some third-party shells perform additional command-line processing before passing the argument list through to cleartool. All descriptions and examples of cleartool command usage assume the standard cmd.exe interpreter.
In interactive mode, cleartool itself interprets the command line; it recognizes various special characters and constructs:
Line continuation (^)
A ^<NEWLINE> sequence is replaced by a <SPACE> character.
Character escape (\)
The two-character sequence \ special-char suppresses the special meaning of the character.
Single-quoting (` `)
Allows white-space characters and other special characters to be included in command argument. Within a single-quoted string (' ... '), a double-quote character (") has no special meaning, and \ ' is replaced by '.
Double-quoting (" ")
Allows white-space characters and other special characters to be included in command argument. Within a double-quoted string (" ... "), \" is replaced by ", and \ ' is replaced by '.
Command lines that begin with a number sign (#) are ignored.
Filename patterns (including *, ?, and so on) that are not enclosed in quotes are expanded as described in the wildcards_ccase reference page. These patterns are also supported in config specs. (The meaning of ellipsis is slightly different in config specs; see the config_spec reference page.)
In interactive mode, cleartool does not expand environment variables.
ClearCase provides for temporary access control through explicit locking of individual objects with the lock command. When an object is locked, it cannot be modified by anyone (except those explicitly excluded from the lock), even a member of the ClearCase group, the VOB owner, and the user who created the lock.
cleartool command descriptions list the locks that can prevent a command from being executed, even if you have the necessary permissions. For example, the chtype command lists three locks that would prevent you from changing an element type:
VOB, element type, pool (non-directory elements only)
This means that chtype would fail if the VOB containing the element were locked, if the element's type were locked (such as the text_file type), or if the storage pool containing the (nondirectory) element were locked.
If you exit cleartool by entering a quit command in interactive mode, the exit status is 0. The exit status from single-command mode depends on whether the command succeeded (zero exit status) or generated an error message (nonzero exit status).
Note that for the diff command, success means finding no differences.
comments, fmt_ccase, pathnames_ccase, permissions, profile_ccase, view, version_selector, wildcards_ccase
Feedback on the documentation in this site? We welcome any comments!
Copyright © 1999 by Rational Software Corporation. All rights reserved.