https://github.com/fredericrous/posh-p4
perforce prompt and auto completion for powershell
https://github.com/fredericrous/posh-p4
Last synced: about 1 year ago
JSON representation
perforce prompt and auto completion for powershell
- Host: GitHub
- URL: https://github.com/fredericrous/posh-p4
- Owner: fredericrous
- Created: 2016-02-29T15:13:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-03-11T17:33:46.000Z (over 8 years ago)
- Last Synced: 2025-03-30T10:33:50.997Z (about 1 year ago)
- Language: PowerShell
- Size: 21.5 KB
- Stars: 14
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
posh-p4
=======
Perforce PowerShell integration. Prompt info and command line autocompletion
- __Prompt for Perforce workspaces__
Show the current depot and the state of files (additions, modifications, deletions) within prompt
- __Tab completion__
Provides tab completion for common commands when using perforce.
E.g. `p4 a` --> `p4 add`
Usage
-----
Tab completion should work out of the box. To configure the prompt, see file `profile.example.ps1` as an example. Basically the function that writes p4 status prompt is `Write-P4Prompt`
If prompt shows a ! instead of the depot tree, it means you have too many views sync to the same folder. Script is limited to 1.
It could also mean your are not connected to perforce. try command `p4 where ...`
_Note on performance: If you navigate at the root of a large repo, prompt will be slow._
_posh-p4 uses `p4 status ...` to know which are files to add or to delete.. there might be other commands that are faster_
Installing via OneGet
--------------------
run in powershell command:
```
Install-Module posh-p4 -Scope CurrentUser -AllowClobber
```
Installing manually
--------------------
Create folder C:\Users\\Documents\WindowsPowerShell\Modules\posh-p4
Copy all files from this repo there.
run command:
```
Install-Module posh-p4
```
The Prompt
----------
PowerShell generates its prompt by executing a `prompt` function, if one exists.
An example of such a function is in `profile.example.ps1`
C:\Users\mydepot\project p4:(//depot/project)>
* when depot path is Green, it means you are sync with the latest submit on this folder
* when depot path is Red, there is newer(s) submit
* whend depot path is Cyan, perforce server was too long to tell status so posh-p4 skiped answer in order to not take too long to display the prompt
By default, the status summary has the following format:
[+A ~B -C]
ABC represent the working directory
* `+` = Added files
* `~` = Modified files
* `-` = Removed files
if there is a `?` instead of a number, it means perforce server took too much time to answer
Inspired by
-----------
- posh-git
- posh-npm
- oh-my-zsh <3
License
--------
Microsoft Public License https://opensource.org/licenses/MS-PL