Global Options

Global options for Helix Server commands can be supplied on the command line before any Helix Server command.

Syntax

p4 [-b batchsize -c client -d dir -H host -p port -P pass -u user -x file -C charset
    -Q charset -Llanguage] [-I] [-G] [-s] [-z tag] cmd [args ...]
p4 -V
p4 -h

Options

-b batchsize

Specifies a batch size (number of arguments) to use when processing a command from a file with the -x argfile option. By default, the batch size is 128.

-c client

Overrides any P4CLIENT setting with the specified client name.

-d dir

Overrides any PWD setting (current working directory) and replaces it with the specified directory.

-I

Specify that progress indicators, if available, are desired. This option is not compatible with the -s and -G options.

-G

Causes all output (and batch input for form commands with -i) to be formatted as marshaled Python dictionary objects. This is most often used when scripting. See Usage Notes.

-H host

Overrides any P4HOST setting and replaces it with the specified hostname.

-p port

Overrides any P4PORT setting with the specified protocol:host:port.

-P pass

Overrides any P4PASSWD setting with the specified password.

-r retries

Specifies the number of times to retry a command (notably, p4 sync) if the network times out.

-s

Prepends a descriptive field (for example, text:, info:, error:, exit:) to each line of output produced by a Helix Server command. This is most often used when scripting.

-u user

Overrides any P4USER, USER, or USERNAME setting with the specified user name.

-x argfile

Instructs Helix Server to read arguments, one per line, from the specified file.

If argfile is a single hyphen (-), instructs Helix Server to read from standard input instead of from a file.

-C charset

Overrides any P4CHARSET setting with the specified character set.

-Q charset

Overrides any P4COMMANDCHARSET setting with the specified character set.

-L language

This feature is reserved for system integrators.

-z tag

Causes output of many reporting commands to be in the same tagged format as that generated by p4 fstat.

-q

Quiet mode, which suppresses informational messages and reports only warnings or errors.

-V

Displays the version of the p4 application and exits.

-h

Displays basic usage information and exits.

Usage Notes

Examples

p4 -p new_service:1234 sync

Performs a sync after connecting to new_service and port 1234, regardless of the settings of the P4PORT environment variable.

p4 -c new_client submit -c 100

The first -c is the global option to specify the client workspace name.

The second -c specifies a changelist number.

p4 -s -x filelist.txt edit

If filelist.txt contains a list of files, this command opens each file on the list for editing, and produces output suitable for parsing by scripts.

Any errors as a result of the automated p4 edit commands (for example, a file in filelist.txt not being found) can be detected by examining the command’s output for lines beginning with "error:"