P4V Custom Tools
You can add custom tools to extend the P4V interface. It’s available under the Tools menu:
![Custom Tool](/assets/CustomTool.CWI5kjLQ.png)
Creating a Basic Tool
The most basic thing we can do is call CMD
. Create a new tool in the dropdown:
![Creating Tool](/assets/CreatingTool.CGS6pDTt.png)
Add a call to C:\Windows\System32\cmd.exe
using the /C
param. Here we simply echo “foobar”.
![Edit Tool](/assets/EditTool.B2OialO9.png)
Once added, it becomes available under the Tools menu:
![Menu Tool](/assets/MenuTool.BwICHOuP.png)
And the boring result:
Calling P4 Commands
A slightly more useful tool would be to show the download size of a depot:
![Calling P4 Commands](/assets/CallingP4Commands.DNx9rZQ9.png)
You can then right-click a depot to execute the tool:
![Execute Tool](/assets/ExecuteTool.BfygFcyg.png)
Which currently outputs:
![Output](/assets/Output.BWlGP_IU.png)
Here is a list of additional argument tokens you can pass:
Importing/Exporting Tools
We can export tools as XML to share with others.