Command-line syntax
The basic syntax for commands is as follows:
p4 [global options] command [command-specific options] [command arguments]
The following options can be used with all p4
commands:
Global options | Description and Example |
---|---|
|
Specifies the client workspace associated with the command.
Overrides
$ p4 -c bruno_ws edit //JamCode/dev/jam/Jambase
|
|
Specifies the client workspace’s character set. Overrides
$ p4 -C utf8 sync
|
|
Specifies the current directory, overriding the environment
variable
C:\bruno_ws> p4 -d c:\bruno_ws\dev\main\jam\Jambase Jamfile
|
|
Format all output as marshaled Python dictionary objects (for scripting with Python).
$ p4 -G info
|
|
Specifies the hostname of the client computer, overriding
$ p4 -H deneb print //JamCode/dev/jam/Jambase
|
|
Specify that progress indicators, if available, are desired.
This option is not compatible with the At present, the progress indicator is only supported by two
commands: submitting a changelist with |
|
Specifies the language to use for error messages from the Helix Server. Overrides
$ p4 -L language info
|
|
Specifies the protocol, host and port number used to connect to
the
Helix Server
service, overriding
$ p4 -p ssl:deneb:1818 clients
|
|
Supplies a
Helix Server
password, overriding
$ p4 -u earl -P secretpassword job
|
|
Specifies the number of times to retry a command (notably,
|
|
Specifies the character set to use for command input and output;
if you have set
$ p4 -Q utf32 -C utf8 sync
|
|
Prepend a tag to each line of output (for scripting purposes).
$ p4 -s info
|
|
Specifies a
Helix Server
user, overriding
$ p4 -u bill user
|
|
Read arguments, one per line, from the specified file. To read
arguments from standard input, specify
$ p4 -x myargs.txt
|
|
To facilitate scripting, displays the output of reporting
commands in the format as that generated by
$ p4 -z tag info
|
|
Quiet mode; suppress all informational message and report only warnings or errors. |
|
Displays the version of the |
To display the options for a specific command, issue the p4
help
command. For example:
$ p4 help add
add -- Open a new file to add it to the depot
p4 add [ -c changelist# ] [ -d -f -I -n ] [ -t filetype ] file ...
Open a file for adding to the depot. If the file exists on the
client, it is read to determine if it is text or binary. If it does
not exist, it is assumed to be text. To be added, the file must not
already reside in the depot, or it must be deleted at the current
head revision. Files can be deleted and re-added.
[...]
For the full list of global options, commands, and command-specific options, see the Helix Core Command-Line (P4) Reference.
Also in this section: