<!– .style1 { font-size: 24px; font-weight: bold; } –>
Perforce Command Line Global Options
Global options for Perforce commands; these options can be supplied on the command line before any Perforce command.
p4 [-cclient -ddir -Hhost -pport -Ppass -uuser -xfile -Ccharset -Qcharset -Llanguage] [-G] [-s] [-z tag] cmd [args …]
p4 -V
p4 -h
p4 -V
p4 -h
Overrides any P4CLIENT setting with the specified client name.
|
|
Overrides any PWD setting (i.e. current working directory) and replaces it with the specified directory.
|
|
Overrides any P4HOST setting and replaces it with the specified hostname.
|
|
Overrides any P4PORT setting with the specified port number.
|
|
Overrides any P4PASSWD setting with the specified password.
|
|
Overrides any P4USER, USER, or USERNAME setting with the specified user name.
|
|
Overrides any P4CHARSET setting with the specified character set.
|
|
Overrides any P4COMMANDCHARSET setting with the specified character set.
|
|
Causes output of many reporting commands to be in the same tagged format as that generated by p4 fstat.
|
|
For example, the command p4 -c anotherclient edit -c 140 file.c will open file file.c for edit in pending changelist 140 under client workspace anotherclient.
•
|
The -x option can be extremely powerful – as powerful as whatever generates its input. For example, a UNIX developer wishing to edit any file referring to an included file.h file, for instance, could grep -l file.h *.c | cut -f1 -d: | p4 -x – edit.
In this example, the grep command lists occurrences of file.h in the *.c files, the -l option tells grep to list each file only once, and the cut command splits off the filename from grep’s output before passing it to the p4 -x command.
For example, a script could be written as part of an in-house build process which executes p4 -s commands, discards any output lines beginning with “info:”, and alerts the user if any output lines begin with “error:”.
•
|
In some cases, it may not be intuitively obvious what keys are used by the client program. If you pipe the output of any p4 -G invocation to the following script, you will see every record printed out in key/value pairs:
Latest posts by Mantosh Singh (see all)
- What is Quantum Computing and How to learn it? - November 3, 2023
- Top 10 IT Corporate Training and Consulting Companies - October 11, 2023
- Google My Business Website – All you need to know? - August 25, 2023