-T Command-line Option
Return to Introduction  Previous page  Next page
The -T option causes the command to terminate as soon as an error at a specific level occurs. If this option is specified on the command-line, and an error occurs, the command will return a non-zero error code:

TC CheckOut *.pas *.dfm -T  

will attempt to checkout all files with a .pas or .dfm extension. If any error occurs, the call terminates and returns a non-zero value. If it succeeds, the call returns zero.

TC Get *.pas *.dfm -VA"1.2.3.4" -T2  

will attempt to checkout all files with a .pas or .dfm extension, and assign the Version Label to all checked out files. If any error occurs at level 2 or above, the call terminates and returns a non-zero value. If it succeeds, the call returns zero.

If you do not specify -T on the commandline, errors are output to the screen, but the command continues execution for the rest of the items and will return 0.

The following table lists ways to use the -V option.

Option
Description
-T
Terminates the command if any error occurs, regardless of the significance (same as -T1)
-T1
Same as -T
-T2
Terminates the command if a level 2 or above error occurs.
-T3
Terminates the command if a level 3 error occurs.


When a command is issued it is sometimes works on a large number of files and inevitably non-significant errors may be raised. For example, checking out a Project and requesting a specific Version Label can cause an error to be raised (level 2) for the files that do not contain that label. Also, checking a file in that hasn't changed can raise the (level 1) error 'File has not changed'. In some cases, these errors are irrelevant to what the user is doing. In this case, you can specify that the command will terminate only when an error at a specific level or above occurs using the switch above.

The following table lists the error levels:

Level
Description
1
Minor error: Err_FileNotChanged, Err_RevisionBranched, Err_FilesTheSame
2
Intermediate error: Err_VersionAlreadyAssigned, Err_FileNotLockedBy, Err_VersionNotFound, Err_FileNotLocked, Err_FileLockedByUser, Err_FileLocked, Err_HasOfflineLock, Err_FileFrozen, Err_ActionCancelled, Err_Cancelled, Err_FileIsWritable, Err_NotCheckedOutFromProject, Err_CannotFindRevision, Err_VersionDoesNotExist, Err_CannotFindVersion
3
Major error: all other error codes


The full list of error codes can be found by downloading the Team Coherence API.

 


© 1995-2018 MCN Software