NAME

ClearCase::Ct - general-purpose wrapper for cleartool program

SYNOPSIS

See also "perldoc ClearCase::Ct::Profile" and "perldoc `whence ct`".

ClearCase::Ct provides service functions and global constants to the ct wrapper program and the ClearCase::Ct::Profile module.

DESCRIPTION

Exported functions:

  • Dbg($string, $level)

    Standard debugging routine. Takes two scalar args: a string to print, plus an optional number of stack frames to go backwards before reporting line number and file data.

  • Die($string)

    Die with a standard error msg format. Same behavior as die() otherwise.

  • Warn($string)

    Warn with a standard error msg format. Same behavior as warn() otherwise.

  • Exec(LIST)

    A wrapper for exec() which handles printing of debug and exec-fail msgs. Also works around a Win32/5.004 bug in exec().

  • System(LIST)

    A wrapper for system() which handles printing of debug tracing. Dies automatically on command failure in void context.

  • Qx(LIST)

    A replacement for `cmd` with no shell needed, as suggested in Camel5. Also more secure in setuid usage. Made available here for use in profiles.

  • Prompt(LIST)

    Run clearprompt with specified args and return results. Temp file creation/removal is handled here automatically. NOTE: the -prompt <string> argument must come last so we can quote it appropriately to deal with the remarkably lame NT shell.

  • DosGlob(LIST)

    On Windows, do the user a favor and handle globbing for DOS shell (as well as possible). Should generally be used after parsing options out of the list so '-c "changed foo from char * to void *"' doesn't get modified. Idea courtesy of Kenneth Olwing <K.Olwing@abalon.se>.

    Takes a reference to a list plus an optional following list. Returns a globbed list. The optional list, if present, is treated as a list of option flags we want to parse off the argv before globbing what remains.

  • Option Parsing

    This is a set of functions based on Getopt::Long::GetOptions():

    1. ReadOptions(\@ARGV, LIST)

    Works much like GetOptions but does not modify the referenced \@ARGV - it's a lookahead option processor.

    2. StripOptions(\@ARGV, LIST)

    Parse and strip the specified options from the referenced \@ARGV, returning the stripped elements as a list (retaining order).

    3. RemainingOptions(\@ARGV, LIST)

    Like GetOptions but does not modify the current @ARGV; instead it returns an array containing the subset of unparsed elements of ARGV.

    4. SplitArgv(LIST)

    Uses GetOptions to break the current scope's @ARGV into two arrays, a list of options and a list of arguments, and returns references to them. Example:

    my($r_opts, $r_args) = SplitArgv(qw(c|cfile=s cq|cqe|nc));

    would assign any of the standard comment flags (-c, -nc, etc.) to the array known as @$r_opts, and any remaining arguments (presumably element names) to @$r_args. Normally you'd want to pass it the full list of options accepted by the current ClearCase command, of course.

    The syntax is identical to that for Getopt::Long::GetOptions(). Notice that we cluster flags of like type together as if they were synonyms even when they're not; this is ok since we're only interested in finding the right number of them, not in applying any semantics here.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 104:

=over without closing =back