Get Started with CA Harvest SCM Commands

This article lets you get started with commands that are used in the .
cahscm101
This article lets you get started with commands that are used in the
CA Harvest SCM
.
Common Options
CA Harvest SCM
provides you with a command line interface. On UNIX and Linux, the command line utilities serve as the
CA Harvest SCM
clients.
CA Harvest SCM
command line utilities use many common features including options and syntax. These features are described in this article, instead of being repeated for every command line utility.
The following options are available for all commands and are not required:
  • -arg
    (Optional) Defines package names that begin with a hyphen (-).
    This option has the following format:
    command ... -arg="-packagename"
    Example:
    hcp ... -arg="-mypackagename"
  • -h
    (Optional) Displays a brief description of help on the command usage.
  • -i
    inputfile.txt
    (Optional) Defines the file name of an input file that contains all command line parameters. It is typically used to prevent login credentials from being displayed on the console. This file is read at program execution. The following considerations apply to the input file:
    • The file must be a regular text file.
    • The file cannot be encoded or encrypted.
    • The input file can have any name and extension, and can reside in any directory.
    • The file must be available before the command is executed.
    • The options and arguments you specify in the file are the same ones available for the command line prompt. They are specified in the same one-line format as the other
      CA Harvest SCM
      command line programs.
    • You cannot specify some options on the command line and others in an input file; they must all be included in one or the other.
    • The input file maximum size is limited only by what the operating system can handle.
  • -di
    inputfile.txt
    (Optional) Defines the file name of an input file that contains all command line parameters. It is typically used to prevent login credentials from being displayed on the console. This file is read at program execution and then deleted as soon as the file is parsed. If you use this option, you cannot also use the -i option. The following considerations apply to the input file:
    • The file must be a regular text file.
    • The file cannot be encoded or encrypted.
    • The file can have any name and extension, and can reside an any directory.
    • The file must be available before the command is executed.
    • The options and arguments you specify in the file are the same ones available for the command line prompt. They are specified in the same one-line format as the other
      CA Harvest SCM
      command line programs.
    • You cannot specify some options on the command line and others in an input file; they must all be included in one or the other.
    • The file maximum size is limited only by what the operating system can handle.
  • -o
    filename
    (Optional) Defines the file name of a file to receive the output log. A file name is required; if one is not supplied, the file
    utilityname
    .log is created in the current working directory
    (utilityname
    is the name of the command being executed). If a file of the same name already exists, the file will be replaced; log information is not appended to the existing file.
    This option cannot also be used with -oa.
  • -oa
    filename
    (Optional) Defines the file name of a file to receive the output log. A file name is required; if one is not supplied, the file
    utilityname
    .log is created in the current working directory
    (utilityname
    is the name of the command being executed). If a file of the same name already exists, log information is appended to the existing file.
    This option cannot also be used with -o.
  • -prompt
    (Optional) Specifies that the user should be prompted for a user name (-usr) and password (-pw) at runtime. This option is typically used to hide login credentials from being exposed in plain text on the command line. Including this option overrides use of -usr and -pw. This option also overrides the -eh option.
  • -v
    (Optional) Specifies that verbose option be used to display all relevant variables being used for the command execution.
    UNIX and Linux:
    Using verbose mode, you can confirm whether the command should actually be process.
    Windows:
    Verbose mode simply writes the appropriate values to the output file.
    An exception is hsigget, which uses the -v option to generate a report with a pre-selected subset of attributes related to version information, including file name, status, tag, version, and package.
  • -wts
    (Optional) Specifies that the timestamp of command line execution be recorded in the output log.
User Credentials
You can determine whether the password is hidden for a command line utility. Most of the commands discussed in this section allow for the specification of
CA Harvest SCM
user credentials or user credentials for a remote operating system (for example, for a file agent login).
If the
CA Harvest SCM
server or file agent process does not allow command line utilities to pass clear-text passwords and if the command line is determined to be passing clear-text passwords, the
CA Harvest SCM
server or file agent process will reject the create session or file agent login request.
Password information is considered hidden on command line utilities if any of the following are true:
  • The command line specifies one of the input file options (for example, -i or -di).
  • The input file option is
    not
    specified and the password option (for example, -pw, -rpw) is
    not
    specified on the command line.
Examples: Determine User Credentials
The following command line statements show examples of how user credentials are determined.
The following statement is
not
considered to have a hidden password because the password option is explicitly specified on the command line:
hco -b 
brokername
 -usr 
username
 -pw 
password
 ...
The following statement is considered to have a hidden Remote OS user password, because even though clear text credentials are being specified, the password is not explicitly specified on the command line. In this case the command will prompt for the user's password information.
hco -b 
brokername
 ... -rm 
remote_computer
 -rusr 
username
 ...
The following statement is considered to have a hidden
CA Harvest SCM
user password because an encrypted credential file is used to specify the user credentials for the command.
hco -b 
brokername
 -eh 
encrypted_credential_file
 ...
The following statement is considered to have a hidden
CA Harvest SCM
user password because the options are specified in the context of an input file:
hco -i 
inputfile
inputfile
contains the following options:
-b 
brokername
 -usr 
username
 -pw 
password
 ...
The following statement is
not
considered to have a hidden
CA Harvest SCM
user password because the password option is specified explicitly, even though the user name and password specifications are overwritten as a result of the -prompt option.
hco -b 
brokername
 -usr 
username
 -pw 
password
 -prompt ...
The following statement is
not
considered to have a hidden Remote OS user password, because even though an encrypted credential file is specified, the remote password option is specified.
hco -b 
brokername
 ... -rm 
remote_computer
 -er 
encrypted_credential_file
-
rpw
 
password
 ...
The following statement is
not
considered to have a hidden
CA Harvest SCM
user password, because even though an encrypted credential file is specified, the password option is specified.
hco -b 
brokername
 -eh 
encrypted_credential_file
 -pw 
password
 ...
Value Specifications
If the value for a command contains one or more spaces, enclose the value with quotation marks (" "). For example, if a view path name contains a space, such as Test Repository, and you specify the following, the process fails:
... -vp \Test Repository
Instead, enclose the value in quotation marks, as follows:
... -vp "\Test Repository"
On the command line, the shell interprets the backslash (\) as a quotation mark if a quotation mark follows the backslash (\"). This sequence leads to parsing errors; other
CA Harvest SCM
errors may occur depending on the order of the arguments on the command line. To avoid this confusion, replace a single backslash with double backslashes preceding a quotation mark, or do not use a single backslash preceding a quotation mark.
For example, instead of:
-vp "\Test Repository\"
use:
-vp "\Test Repository\\"
or
-vp "\Test Repository"
Command line parameters such as -vp "\Test Repository\" in an input file, when using option -i or -di, will be parsed correctly.
CA Harvest SCM
does not interpret the backslash (\) as a special character.
On UNIX or Linux, view paths that contain subsequent paths must be enclosed in quotation marks even though they contain no spaces. For example:
-vp "\Testrepository\path1"
Specify Syntax Options
To specify command options, use one of the following syntax models:
-
optionname
 
optionarg1
 [... 
optionarg
n ]
-
optionname
=
optionarg1
 [... 
optionarg
n ]