Perforce: Formatting, Scripting, and the Command-line Interface

1 Minute(s) to read

Overview

In this blog post I will discuss some of the convenient tricks that you can leverage when navigating Perforce and its command-line interface. A lot of these are well documented in a post that's available on Perforce's website, but this blog post will look at a few of those features with more detail.

Arguments

The Perforce command-line interface features support for a variety of useful global command-line arguments that can be used for altering the output and and operation of the command-line tool.

Formatting Output

The output from the Perforce command-line interface can be used using a combination of the -ztag, -e, and -F command-line arguments.

-ztag

The -ztag global command-line argument displays the standard output from the Perforce command-line interface in a format that conforms to a specification.

The specification is denoted in that each "key" or "attribute" of an object, is prefixed with "... " and then proceeded by the name of the key. The data for that particular attribute or property is then displayed afterwards using a white-space character as the delimiter. Find below an example.

Usage

 

-e and -F

These global command-line arguments are particularly useful for filtering and identifying "keys", "properties" or "attributes" from resulting attributes that we wish to extract from the output.

Usage

Scripting

Understanding how these global command-line arguments can be used is incredibly powerful. With this, we can now write additional applications that is capable of executing this commands and parsing the command-line standard output.

Other Tricks



Comments

Gravatar for EllaCicbc

<a href=http://imitrex-sumatriptan.com/>http://imitrex-sumatriptan.com</a> - buy imitrex pills online <a href=http://imitrex-sumatriptan.com/#>buy sumatriptan no prescription</a>

Gravatar for HannahCicns

<a href=http://canadianonlinepharmacyctbm.com/>http://canadianonlinepharmacyctbm.com</a> - cvs pharmacy online <a href=http://canadianonlinepharmacyctbm.com/#>best online non prescription pharmacy</a>