Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _perforce to add pid completion



Adds pid completion to the p4 monitor (clear|terminate) commands.

-FR.
Index: Completion/Unix/Command/_perforce
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_perforce,v
retrieving revision 1.24
diff -u -r1.24 _perforce
--- Completion/Unix/Command/_perforce	12 Jan 2005 10:32:20 -0000	1.24
+++ Completion/Unix/Command/_perforce	18 Apr 2005 15:28:52 -0000
@@ -1311,6 +1311,15 @@
 }
 
 
+(( $+functions[_perforce_pids] )) ||
+_perforce_pids() {
+  local -a ul
+
+  ul=(${${${(f)"$(_perforce_call_p4 monitor monitor show 2>/dev/null)"}# *}/\ /:})
+  [[ $#ul -eq 1 && $ul[1] = '' ]] && ul=()
+  _describe -t id 'process ID' ul
+}
+
 
 (( $+functions[_perforce_users] )) ||
 _perforce_users() {
@@ -1808,7 +1817,7 @@
       ;;
 
       (terminate|clear)
-      _message "process ID"
+      _perforce_pids
       ;;
 
       (*)


Messages sorted by: Reverse Date, Date, Thread, Author